A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: decimal issue....

  1. #1
    Junior Member
    Join Date
    Nov 2001
    Posts
    24
    I've made a calculation in a text field....now how can I have that calculation go to only 2 decimal places and round up>??


  2. #2
    Senior Member
    Join Date
    Jan 2002
    Posts
    368
    a frequently asked question, should be able to find it in a search, but...


    value=Math.round(value*100)/100; for round
    value=Math.ceil(value*100)/100; to round up
    value=Math.floor(value*100)/100; to round down

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center