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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change decimal point in number

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
HI All,

i have created a simple calculator script using submit buttons, and everything works, except one thing..

i need to make the number generated into a decimal number for example

i need to change

132456

into

1324.56

any ideas

cheers
 
i forgot i also need to know how to remove a number on the right of the figure. if a mistake is made.. ie a clear button will remove the last digit in the number created
 
divide by 100
Code:
function convertNumber($num){
   $res = $num /100;
   return $res;
}

convertNumber(123456);

that what you meant? or am i going in the wrong direction?

and can you make it a bit clearer by "remove a number on the right of the figure"


Regards,

Martin

Gaming Help And Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top