SOLVED
Extract first 4 decimal places digit with the whole number part from a given Integer
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
cs2kiit17
5 - Atom
‎06-20-2022
08:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi All,
I want to use regex tool or any other optimized method to get the whole number part with the 1st 4 decimal places digit of the corresponding integer.
Sample:
Input Value | Output Value |
1 | 1 |
0.566612345 | 0.5666 |
1.45 | 1.45 |
0.123456789128908888 | 0.1234 |
Please Note: Using Select Tool to convert the datatype into FixedDecimal(19,4), is rounding the values. So need the solution without any rounding-off.
Solved! Go to Solution.
Labels:
- Labels:
- Regex
3 REPLIES 3
15 - Aurora
‎06-20-2022
08:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
‎06-20-2022
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!
Can you also please help me understand the regex formula you have used.
P.S. I am new to regex formulas.
15 - Aurora
‎06-20-2022
09:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Please see below :
\d+ : One degit or more
.\d{4}: 4 degit after the dot
|: OR
\d+ : one degit or more (In case you have an integer)
Happy to help!
Regards
