PHP String Exercises : Format values in currency style
PHP String: Exercise-8 with Solution
Write a PHP script to format values in currency style.
Sample values : value1 = 65.45, value2 = 104.35
<?php $value1 = 65.45; $value2 = 104.35; echo sprintf("%1.2f", $value1+$value2)."\n"; ?>
PHP Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?