Write a PHP script which rounds the following values with 1 decimal digit precision.
Sample values :1.651.65-1.54
<?php echo round( 1.65, 1, PHP_ROUND_HALF_UP)."\n"; // 1.7 echo round( 1.65, 1, PHP_ROUND_HALF_DOWN)."\n"; // 1.6 echo round(-1.54, 1, PHP_ROUND_HALF_EVEN)."\n"; // -1.5 ?>
Sample Output:
1.7 1.6 -1.5
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer