Round of decimal values in double
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have field that is imported from Excel. The default data type assigned to this field was v_string. The value on alteryx looked in exponential format. So I tried to convert it into fixed decimal format. But the value displayed in null. Hence I converted it using double. Now the issue I am facing, is some values have 4 digits after decimal and some have 5,6,7. I want this to be uniform. Can someone help with this.
- Labels:
- Predictive Analysis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hegdepavithra10 you can use the Round function in the formula tool to round to certain decimal point e.g Round(Field,0.01) will round to two decimal places.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you please provide a sample file and what is the expected output we can look into it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So the value looks like 1.000000009999999999999E-4,this is v_string format. I want this to be converted to a proper decimal field with uniform rounding off. After I have used double the values are - 0.0014101, 0.00141.
I just need them to rounded off uniformly across all the values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @hegdepavithra10 I mocked up a workflow that showcases how to do that. Let me know what you think?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hi,
i tried the solution you have provided. I used round([Field],0.0001). This however, turned some of the values into 0.001 and others to 0.0001. Can this be made uniform?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Here is what you can do
Set datatype to Fixed:Decimal like below
Scale is number of decimal points
Output:
Happy to help 🙂
Cheers and Happy Analyzing 😀
