Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: flash 4: more charactres than defined in textbox |
From: | John Dowdell |
Date: | Tue, 24 Oct 2000 21:26:31 +0100 |
At 6:30 AM 10/24/0, kristoff wrote:
> How would I avoid flash changing figures like 90 into 89.4564138799 etc?
It sounds like that number is being treated as a floating-point value,
rather than as an integer. (Computers can express integers precisely, but
floating-point values are always approximations.)
For "How can I convert a float to an integer?" then in Flash 4 we used the
floor function of:
int(value);
In the current version the model is JavaScript, so the standard Math.floor
function is used:
Math.floor(value);
These functions truncate to the lowest integer... 2.97 will go down to 2.
In this case the goal is to round rather than truncate, and the usual way
is to add .5 to the value for rounding. Try this:
displayField = Math.floor(value + .5);
This will convert a floating-point value to the nearest integer for display.
jd
John Dowdell, Macromedia Tech Support, San Francisco CA US
Search technotes: http://www.macromedia.com/support/search/
Offlist email risks capture by the spam filters. I may not see your
email if it's not on the list. Private one-on-one email options are
available via Priority Access: http://www.macromedia.com/support/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre
Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]