Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple question, calculation with numbers...

Status
Not open for further replies.

commun1

Programmer
May 26, 2004
41
DE
I habe some vars containing numbers which look like this.

Code:
$number1 = 1.10

when I echo this var I get 1.1 as a result, so the last 0 is been dumped. I need the 0 to be stored too though, for further calculations and so that it is printed as 1.10

how do I achieve that? can you give me an example?
I suppose I'd need floating numbers but how do I tell the script that I only need 2 digits after the preceding point?
 
that's what I was looking for!

thank you =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top