money (function)

Last updated: Sat, Jan 14, 2023 3:42 pm
Return to Knowledgebase

Purpose

Formats numbers to US currency format

Location

users/helpers/helpers.php

Version Information

First Introduced v2.5.0

Parameters

# Parameter Data Type Required Description
1 $ugly float Yes provide a number like 2000 or 2000.3 to be converted into US money formatting.

Returns

Data Type Description of Returned Data
string Returns numbers formatted in the way we typically write prices in the US.

Example

echo money(20.50);

Further Documentation:

Note: It is not recommended that you store currency symbols in the database along with the amounts.

prints $20.50