Number to 2 decimal places: Text function and Round function not working...

I have the following expressions for a virtual column.  I'm trying to get the numeric value to 2 decimal places.

Concatenate(TEXT(ROUND([Consumo Grande]*1000/(24*60*60)*100)/100)," L/S") *the ROUND and TEXT functions are essentially performing the same function....limiting it to 2 decimal places...

Concatenate(ROUND([Consumo Grande]*1000/(24*60*60)*100)/100," L/S")

And I've Tried:

Concatenate(TEXT([Consumo Grande]*1000/(24*60*60)," L/S") because the TEXT function limits it to 2 decimal places.

When I save a new record to test, it shows the value to 2 decimal places ("5.08 L/S"), then quickly changes it to a value with no decimal places...("5 L/S").

If I just have the Concatenate without TEXT or ROUND...I see a very long decimal number for a very short time, then it changes to a value with no decimal places...

The column is set to type Text

Solved Solved
0 6 2,263
2 ACCEPTED SOLUTIONS

Dividing an integer by an integer results in an integer. Change either dividend or divisor to a decimal to get a decimal result. Easy way here is to divide by 100.0 instead of 100.

Related:

Re: How to ROUND to whatever interval you want. - Google Cloud Community  

View solution in original post

Thank you Mark! I learned something new today. This one was strange, I read the decimal documentation and it matched up with what you said, but in practice I couldn't get it to work. In the end I had to change both the divident and last divisor into decimals to make it stop reverting. 

 

CONCATENATE(ROUND(DECIMAL([Consumo Grande])*1000/(24*60*60)*100)/100.0," L/S")

 

View solution in original post

6 REPLIES 6
Top Labels in this Space