Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Currency Numbers



Hi,
> on currency_format for v
> tell (v mod 1 as text) * 100 to (v div 1 as text) & (0.0 as text)'s
> character 2 & ((it * it) ^ 0.5 + 0.5) div 1
> end currency_format
the full tread it's very interesting and I've learned a lot ... but

 currency_format for -123.995 => "-123,100" on an Italian system.

Since all that was aimed at roundig currency format it shuld be "124.00".

so here is my suggestion

on currency_format for v
    ((round v * 100) div 100 as text) & text 2 thru 4 of (((abs (round (v
mod 1 * 100)) / 100) as string) & "0")
end currency_format


nino

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.