Jump to content

Decimal numbers


common

Recommended Posts

hi i'm busy with a php practical and need help with decimal numbers.

 

The worked out a sum and its answer displays 18.5953893.

 

I need it show only 2 numbers after the break, like 18.60

 

Can anyone help me please??

 

$number = 18.5953893;

 

$new_number = number_format($number);

 

 

Link to comment
https://forums.phpfreaks.com/topic/145624-decimal-numbers/#findComment-764509
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.