# How to round a number but keeping the trailing zeros?

Topic Labels: Formulas
Solved
1664 4
cancel
Showing results for
Did you mean:
9 - Sun

I have some numbers i need to include in a string.

These numbers needs to be rounded down to two decimals, which I use ROUND() to do, my problem comes if the number has trailing zero's fx:

• 233.50 becomes 233.5
• 233.00 becomes 233

Does anyone know how can keep the trailing zeros?

1 Solution

Accepted Solutions
11 - Venus

It looks easy, but it was a bit of a challenge.

``````ROUNDDOWN({Number}, 0) &
"." &
IF(
FIND(".",ROUND({Number}, 2)&""),
REGEX_EXTRACT(
ROUND({Number}, 2)&"0",
"\\.(\\d{1,2})"
),
"00"
)
``````

There has been a number field update recently, and it would be nice if formatted numbers could be used in Formulas as well.

4 Replies 4
7 - App Architect

You should be able to resolve this issue by specifying the precision on your formula field in the formatting tab when you edit a field. If your formula field is a number you should get a result like this where you can specify the decimal places you would like to be visible.

Thank you for this, however the number is part of a longer text. Like: "blablablabla £250.00 blablabla"

So it's how do I get the 250.00 to be "blablablabla £250.00 blablabla" instead of "blablablabla £250 blablabla"?

11 - Venus

It looks easy, but it was a bit of a challenge.

``````ROUNDDOWN({Number}, 0) &
"." &
IF(
FIND(".",ROUND({Number}, 2)&""),
REGEX_EXTRACT(
ROUND({Number}, 2)&"0",
"\\.(\\d{1,2})"
),
"00"
)
``````

There has been a number field update recently, and it would be nice if formatted numbers could be used in Formulas as well.

9 - Sun

This is beautiful, thank you so much. It was not as easy as I thought it would have been.