# I need a formula for 2 decimal digits mixed with text

Topic Labels: Formulas
Solved
646 13
cancel
Showing results for
Did you mean:
4 - Data Explorer

I'm new here so I do not know that many formula. I imported my tables from excel and I have it generate name of the product with product name + weight. However, I want the numbers that are generated in 2 digits format. And here is my current formula :

"[90.0]"&" "&{product name}&" "&{weight)}
I tried using Round(), but it didn't help.
1 Solution

Accepted Solutions
12 - Earth

I tried to use your values and have the same mistake. I suppose it's because 2.30 stored in dataset as smth like 2.29999999999997. a few minutes and I'll find the solution

UPDATE: it works, when using ROUND instead of INT

``{productname}&" "&ROUND(weight)&"."&RIGHT(''&ROUND(weight*100),2)``
13 Replies 13
4 - Data Explorer
CONCATENATE("[90.0] ",{productname}," ",ROUND({weight},2))

This formula does not work either
12 - Earth

Hi,
If 2-digit means numbers like 2.1, 1.9 , the number of digits can be set in field settings.

9 - Sun

If I understand correctly this should work

{productname}&" "&INT(weight)&"."&RIGHT(""&(weight*100),2)
4 - Data Explorer

I did work for some of it but I don't understand why some of them aren't correct

12 - Earth

Because some weight values having more digits, despite displaying just two after point, and RIGHT takes last two of them. You can see it by adding more digits in field settings.
Sorry, i didn't understand at first what's wrong with result. In you case, I would insert the dot on a right place

``````REPLACE(productname&' '&INT(weight*100),
LEN(productname&' '&INT(weight*100))-1,0,'.')``````

4 - Data Explorer

some of it seems correct but still I have problems with the weight 2.30 that is now shown as 2.29 and 1.15 is now shown as 1.14. I don't understand why it did not directly use the number in the weight field

4 - Data Explorer

I copied your formula and pasted it, but parts of it still gave incorrect results

12 - Earth

Or even a bit easier, just apply INT to a second weight value to cut all extra digits after these two

{productname}&" "&INT(weight)&"."&RIGHT(''&INT(weight*100),2)
12 - Earth

I tried to use your values and have the same mistake. I suppose it's because 2.30 stored in dataset as smth like 2.29999999999997. a few minutes and I'll find the solution

UPDATE: it works, when using ROUND instead of INT

``{productname}&" "&ROUND(weight)&"."&RIGHT(''&ROUND(weight*100),2)``