- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 24, 2024 08:42 PM
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 :
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:47 PM - edited ‎Apr 25, 2024 11:52 PM
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)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 24, 2024 08:51 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 24, 2024 10:31 PM
Hi,
Please type desired output.
If 2-digit means numbers like 2.1, 1.9 , the number of digits can be set in field settings.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 07:44 AM
If I understand correctly this should work
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 10:35 PM
I did work for some of it but I don't understand why some of them aren't correct
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:24 PM
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,'.')
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:33 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:36 PM
I copied your formula and pasted it, but parts of it still gave incorrect results
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:40 PM
Or even a bit easier, just apply INT to a second weight value to cut all extra digits after these two
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Apr 25, 2024 11:47 PM - edited ‎Apr 25, 2024 11:52 PM
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)
