Flasher Archive

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


Subject: Re: FLASH: Limiting number of decimal places in a variable?
From: Stephen J. Pintauro
Date: Mon, 5 Jun 2000 14:02:39 +0100

Hello Branden,
Thanks so much for the solution. That is a great little math trick. I will definately have use
for it in other applications. It works great!
Thanks again,
Stephen Pintauro

Branden Hall wrote:

> Take the answer... add 5 to the decimel place you will be cutting off
> before...
> i.e. if you want .XX format you would add .005. Then multiply the answer
> times 10 and then times the number of decimel places you want, in this case
> 100. Then take the integer of this number and divide it by 100. Then look
> at 3rd to the last character of the number, if its not . then add 0s to the
> string as needed.
>
> In psuedocode:
>
> answer = int((answer+.005)*100)/100
> if substring(answer, (length(answer)-3), 1)
> answer = answer & "0"
> endif
> if substring(answer, (length(answer)-3), 1)
> answer = answer & "0"
> endif
>
> Thats it!
>
> -= 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 Stephen
> J. Pintauro
> Sent: Friday, June 02, 2000 6:33 AM
> To: Flash List
> Subject: FLASH: Limiting number of decimal places in a variable?
>
> Hello all,
> I am playing with some arithmetic calculations in a Flash page. It is
> pretty straightforward, however, i cannot figure out how to limit the
> number of decimal places in a calculation. For example, when a user
> enters their weight in pounds, i use a "set variable" function to
> convert that to kilograms. So, if they enter 155 pounds, the "set
> variable" function calculates the value of the variable "kilograms" to
> 155 / 2.2 = 70.4545454545. How can I get it to set the variable to
> 70.46?
> Thanks in advance,
> Stephen Pintauro
>
> --
> *****************************
> Stephen J. Pintauro, Ph.D.
> Associate Professor
> Department of Nutrition and Food Sciences
> University of Vermont
> Phone: 802-656-0541
> http://nutrition.uvm.edu/
>
> flasher is generously supported by...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> World Animation Celebration - Big Internet Animation Pow Wow Discount Offer
>
> Register before May 25 mention flasher and save 25%!! www.wacfest.com
>
> Be discovered, get a job or have your web series picked up. A big talent
> search for Shockwave
> and Flash animators is happening May 30-June 4 in Hollywood. Featuring Rob
> Burgess, Matt
> Groening, Brad Bird and more. www.wacfest.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...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> World Animation Celebration - Big Internet Animation Pow Wow Discount Offer
>
> Register before May 25 mention flasher and save 25%!! www.wacfest.com
>
> Be discovered, get a job or have your web series picked up. A big talent search for Shockwave
> and Flash animators is happening May 30-June 4 in Hollywood. Featuring Rob Burgess, Matt
> Groening, Brad Bird and more. www.wacfest.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpatchinwag [dot] com

--
*****************************
Stephen J. Pintauro, Ph.D.
Associate Professor
Department of Nutrition and Food Sciences
University of Vermont
Phone: 802-656-0541
http://nutrition.uvm.edu/



flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
World Animation Celebration - Big Internet Animation Pow Wow Discount Offer

Register before May 25 mention flasher and save 25%!! www.wacfest.com

Be discovered, get a job or have your web series picked up. A big talent search for Shockwave
and Flash animators is happening May 30-June 4 in Hollywood. Featuring Rob Burgess, Matt
Groening, Brad Bird and more. www.wacfest.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  RE: FLASH: Limiting number of decimal pl, Branden Hall

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