Q:

Write a PHP script to format values in currency style

0

Write a PHP script to format values in currency style.

Sample values : value1 = 65.45, value2 = 104.35

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$value1 = 65.45;
$value2 = 104.35;
echo sprintf("%1.2f", $value1+$value2)."\n";
?>

Sample Output:

169.80

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now