Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    roung function

    Hi,

    I have to calculate a amount field based on the below formula,


    installamountto=netamountto/term.

    The output sometimes can come like


    3.3333333,or 45.777777,etc.It can be any value but i want to round the decimal to only 2 digits or suppose for example if the value is 45.45,round it to 45.5.


    How do i achieve this using javascript.

    Thanks

    Rama

  • #2
    WA
    WA is offline
    Administrator
    Join Date
    Mar 2002
    Posts
    2,596
    Thanks
    2
    Thanked 19 Times in 18 Posts
    Check out the following tutorial on JavaScriptKit: http://www.javascriptkit.com/javatutors/round.shtml

    Hope it helps,
    - George
    - JavaScript Kit- JavaScript tutorials and 400+ scripts!
    - JavaScript Reference- JavaScript reference you can relate to.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    rounding ofnumbers

    Hi,

    Tutorial was useful .thank u.


    Rama


  •  

    Posting Permissions

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