Re: Decimal Point Truncations?
Re: Decimal Point Truncations?
- Subject: Re: Decimal Point Truncations?
- From: Pier Kuipers <email@hidden>
- Date: Thu, 8 Feb 2001 22:36:59 +0000
>
I want to get the disk size and display the result in Gb with one decimal
>
place (If possible). Currently, the full code above gets something like
>
54.6464646748783838.
Here's what i cobbled together a few years ago. Not as fancy (read:
concise) as some of the stuff I've seen, but it works. And I
understand how it works, too... I think.
set y to 54.64646467487
set p to (count ((y - (y div 1)) as text))-2
if p > 1 then
set x to (y - (y div 1)) * 10
set q to (x + 0.5) div 1
set r to (y div 1) + (q / 10)
else
set r to y
end if
Pier.
--
Pier Kuipers
Visual ID
* the Media Asset Management solution *
2 Whitefriars
Aungier Street
Dublin 2
Tel. +353 1 476 7059
Mobile +353 87 294 3063
Fax +353 1 478 1366
ISDN +353 1 602 0754
http://www.visualid.com