Format Value --> Currency

Hi !
If I add "12.25" to "12.25" I get "24.5" as result but I want
to get "24.50" ! How can I format this ?

regards
ItsMe
ItsMeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
KennyConnect With a Mentor IT Application ExecutiveCommented:
$TotalPrice=sprintf " %0.3f", (12.25+12.25);
0
 
ItsMeAuthor Commented:
thanks !
0
 
KennyIT Application ExecutiveCommented:
Oops...It is supposed to be :

$TotalPrice=sprintf " %0.2f", (12.25+12.25);

Mine had 3 decimal places.
0
 
ItsMeAuthor Commented:
I already corrected this ;-)
0
All Courses

From novice to tech pro — start learning today.