how to display cash number format in a php code?

Recommended Answers

Please give an example.

Jump to Post

Please see the following link.

http://php.net/number_format

Jump to Post

All 7 Replies

Please give an example.

cash_system value suppose to show for example. 994.00 but instead it shows 994.

<?php

  echo "Cash:", " ". $info['cash_system'];
  echo "<BR>";
  ?>

will this work with my code or do i need to insert that number format under it?

Please try:

echo "Cash:", " ". number_format($info['cash_system'], 2, '.', '');

my go to for formatting cash is: echo sprintf("%01.2f",$someFloat);

thanks this works. This will be marked as solved! Thanks everyone!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.