So I have a string. It’s a decimal number, something like “0.00854748338”.
I want to somehow match or format this string to where it returns “0.00”, which I could then get the amount of zeroes before a non-zero number (which would be 3 in this case, using the # operator - 1). I could then multiply the initial decimal by 10 raised to that number to get a whole number. (0.0085… * 10^3 = 8.5)
How would I go about doing this? I’ve been looking at the string.match page and I can’t seem find a specific set of classes to achieve what I want. I thought about using the string.format “%s” modifier to convert it to scientific notation and then get the amount of digits from there, but I am seeing issues with that approach and it seems like too much work.