**HELP** Flash Actionscripting

Out of context: Reply #8

  • Started
  • Last post
  • 14 Responses
  • magicspoon0

    Hey-
    I actually just did this for a project.
    You basically want to do what everyone else is saying.
    What i did (not saying this is the best way to do it- just what i did):

    1. to get 2 decimal place output (i.e.$34.50 not 34.564565)
    You multiply the number by 100, round it, then divide by a 100

    2. to add commas in, you make it a string, split it at the '.' and from there you loop through the myString[0] that is made(left gobbleygook of decimal), and create a local increment var that loops through the string, counts to 3, adds a comma, reset the increment var, and continue like so ad infinitum until you get to the end of your number string.

View thread