Flasher Archive

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


Subject: RE: FLASH: Formatting Numbers #2
From: jwoodw - Jeffrey Woodward
Date: Thu, 6 Jul 2000 23:28:19 +0100

Hi folks,

Thanks to all that tried to help me out with the formatting question.
Unfortunately, I couldn't get any mathmatical solution to work. Since
ActionScript doesn't have a modulus operator, I'm not sure that a
mathmatical solution is possible given that my number variable changes
depending upon an input variable.

I did finally get a variation of Frank Pichel's suggestion to work however
(Thanks Frank!). I basically had to write a function as follows, where
/:totalSavings is my final number with "m" for "millions", "t" for
thousands, etc:

If (Length (/:totalSavings) = 4)
Set Variable: "t" = Substring (/:totalSavings, 1, 1 )
Set Variable: "h" = Substring (/:totalSavings, 2, 3)
Set Variable: "/:totalSavings" = t & ", " & h
Else If (Length (/:totalSavings) = 5)
Set Variable: "t" = Substring (/:totalSavings, 1, 2 )
Set Variable: "h" = Substring (/:totalSavings, 3, 3 )
Set Variable: "/:totalSavings" = t & ", " & h
Else If (Length (/:totalSavings) = 6)
Set Variable: "t" = Substring (/:totalSavings, 1, 3 )
Set Variable: "h" = Substring (/:totalSavings, 4, 3 )
Set Variable: "/:totalSavings" = t & ", " & h
Else If (Length (/:totalSavings) = 7)
Set Variable: "m" = Substring (/:totalSavings, 1, 1 )
Set Variable: "t" = Substring (/:totalSavings, 2, 3 )
Set Variable: "h" = Substring (/:totalSavings, 5, 3 )
Set Variable: "/:totalSavings" = m & ", " & t & ", " & h

and so on, and so forth...

If anyone thinks of a better and/or easier way of doing this I'd sure like
to know about it. Otherwise, thanks again for the thoughts and suggestions!

Jeff

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 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


Replies
  Re: FLASH: Formatting Numbers #203,393,9, Helen Triolo
  Re: FLASH: Formatting Numbers #2, Helen Triolo

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