Remove rear zero on decimal

For remove the unused zero on decimal with money format.

Ex: 30000.890 > 30,000.89

rtrim( number_format('30000.890', 9), '0.');
  • number_format for add comma on thousand
  • 9 for size of decimal
  • 0 & . is values are removed by rtim when exist in last number

Function Snippet by gueprogramer

Ali Akbar

Gue programer B)

Related Posts
Leave a reply