Flasher Archive

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


Subject: Re: FLASH: Formatting Numbers, decimals
From: Wayne Pennell \( Web Master \)
Date: Thu, 13 Jul 2000 15:33:42 +0100

lol seems a bit heavy to me I would take the int covert it to string look
for (.) char +3 get the value of .12(6) If char(x) >=6 round up +1 to int
else <=5 do nothing. Convert back and concat.

int(a) & "." & int(x) 23.13

Wayne Pennell
----- Original Message -----
From: "Branden Hall" <bhallatfigleaf [dot] com>
To: <flasheratchinwag [dot] com>
Sent: Wednesday, July 12, 2000 11:55 AM
Subject: RE: FLASH: Formatting Numbers, decimals


The best way I have found is:

say we have the number 23.12623
and we want to reduce it down to 23.13
first take the int of the number and subtract that from the actual number to
get .12623
then add .005 to that to get .13123
then multiply that times 100 to get 13.123
then take the int of that (13) and divide it by 100 to get .13
then just add .13 to the int of the orginal number (23) to get 23.13

-= Branden J. Hall
-= Multimedia Developer / Instructor
-= Fig Leaf Software - "We've got you covered!"


-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Helen
Triolo
Sent: Wednesday, July 12, 2000 11:41 AM
To: flasheratchinwag [dot] com
Subject: Re: FLASH: Formatting Numbers, decimals


jwoodw - Jeffrey Woodward wrote:
>
> I guess the only problem left with this issue is to take care of numbers
> that happen to come out as decimals, i.e. - .54321 - Would you use some
more
> "If" statements to handle this scenerio?

If the number might be a decimal (of unknown precision), I'd add another
loop to scan the string from right to left until the decimal is found,
and note where it appears (set a variable). Then modify the existing
code to not put out any commas before the decimal is reached (and modify
the line that checks for multiples of 3 to take into account the extra
stuff to the right of the decimal). That's what I'd do but maybe
there's an easier way -- if you come up with a good routine, post the
code!

---------------------------------------------------
helen triolo � http://i-technica.com � 301-424-6037
Flash Q&A archive � http://i-technica.com/flashlist


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


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, decimals, Branden Hall

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