#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    A little help, new to programing.


    i am working on a program Gic Calculator.

    i have a question.

    TSX rate = (107-100)/100 = 7%.
    that is the req, but if it do (107-100)/100 i get 0.07 (using float)

    I need to print out 7%, but the way i know is to multiply it by 100 to convert it to %. is their any way to print it with format like %.2f

    thanks
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0

    Post or


    is their any way to move decimal places forward?

    thanks, please reply.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    3
    Rep Power
    0
    is there anyone who knows???? 30+ views but no reply? :(
    is it even possible? plz tell me

    Comments on this post

    • salem disagrees : Yeah, and how many of those 30 were you refreshing the page to bump your thread and check for replies
  6. #4
  7. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,145
    Rep Power
    2222
    You move the decimal point to the left by dividing by powers of 10. And to the right by multiplying.

IMN logo majestic logo threadwatch logo seochat tools logo