# to_money

Converts a Long, Double, String, or equivalent expression to money in the currency of whatever scope it's being evaluated in.

## Syntax

`to_money(x)`

### Parameter

X can be a Long, Double, String, or equivalent expression.

If your locale uses a comma to separate decimals, surround any Long, Double, String you enter with quotes. For example, these two formulas are equivalent:

• `To_money(“1,50”)` - A comma separates the integer from the decimal, so you need to surround the amount with quotes
• `To_money(1.50)` - A period separates the integer from the decimal, so you don't need to surround the amount with quotes

## Examples

• `to_money(Clicks * 0.02)` or `to_money(Clicks * to_money("0,02"))`
In this example, an advertiser places a value of 2 cents for each click. So the advertiser creates a formula that multiplies the number of clicks by 2 cents and converts the result to money. By placing this formula in a column on the Campaigns tab, the advertiser can easily compare the value generated by each campaign.

Both formulas are equivalent. The second formula uses a comma to separate decimals.

• `if(Cost > to_money(100.50), "coût élevé", "--")`
or `if(Cost > to_money("100,50"), "coût élevé", "--")`
In this example, an advertiser wants to display a notice on the keywords report if the cost of a keyword rises above 100 dollars and 50 cents. So the advertiser creates a formula that converts 100.50 (or "100,50") to money. Then the formula compares the result with the cost of a keyword. If the cost is higher than 100.50, the formula outputs "coût élevé". The advertiser places this formula in a column on the Keywords tab. Then the advertiser uses the column to sort the report and display all expensive keywords at the top of the report.