Jump to content

[SOLVED] Math in PHP


winmastergames

Recommended Posts

Well i made this little script to turn Watts into KW by dividing the number by 1000

This Code:

<?php echo floor($_GET['number']/1000); ?>

But, It doesn't have any decimal places as an example if you used this code with 3500 it will give out 3 is there any way to make it have one decimal place so it will give out as an example 3.5

Thanks Alot  ;D

Link to comment
https://forums.phpfreaks.com/topic/110025-solved-math-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.