Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: FLASH: Format Currency (was Text Box Properties)
From: Matt Wobensmith
Date: Fri, 4 Feb 2000 01:12:21 GMT

Jason asked:

>I need to have the variable in the text box appear as a dollar amount. Problem
>is, when adding .25, it drops off the last digit.
>
>For example, .25 + .25 = .5
>
>This is correct, but when talking about money, it should be .50.
>
>How do I do this?


Try this script - your amount would be the variable "x".

-Matt



Set Variable: "cents" = int(x*100+0.5)
If (cents < 10)
Set Variable: "result" = "$0.0" & cents
Else If (cents < 100)
Set Variable: "result" = "$0." & cents
Else
Set Variable: "result" = "$" & substring(cents, 1, length(cents)-2) & "." & substring(cents, length(cents)-1)
End If

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World�s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]