I would like to round a number to two decimal places in PHP.
PHP code:
$bmi = ($form_state[values][submitted][1] * 703) /
($form_state[values][submitted][10] * $form_state[values][submitted][10]);
$form_values['submitted'][11] = $bmi;
$form_values['submitted_tree'][11] = $bmi;
What is the best way to round the variable $bmi?
round ($your_variable, 2)
https://www.php.net/manual/en/function.round.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With