Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
February 10th, 2013, 06:58 PM
 shank09
Registered User

Join Date: Feb 2013
Posts: 3
Time spent in forums: 59 m 27 sec
Reputation Power: 0
A little help, new to programing.

i am working on a program Gic Calculator.

i have a question.

Quote:
 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
February 10th, 2013, 07:31 PM
 shank09
Registered User

Join Date: Feb 2013
Posts: 3
Time spent in forums: 59 m 27 sec
Reputation Power: 0
or

is their any way to move decimal places forward?

#3
February 10th, 2013, 08:22 PM
 shank09
Registered User

Join Date: Feb 2013
Posts: 3
Time spent in forums: 59 m 27 sec
Reputation Power: 0
is there anyone who knows???? 30+ views but no reply?
is it even possible? plz tell me
salem disagrees: Yeah, and how many of those 30 were you refreshing the page to bump your thread and check for
replies

#4
February 10th, 2013, 08:57 PM
 dwise1_aol
Contributing User

Join Date: Jan 2003
Location: USA
Posts: 6,865
Time spent in forums: 3 Months 1 Day 7 h 36 m 3 sec
Reputation Power: 2199
You move the decimal point to the left by dividing by powers of 10. And to the right by multiplying.

 Viewing: Dev Shed Forums > Programming Languages > C Programming > A little help, new to programing.