toFixed operator - Does it work?

Hello:

I’ve been working on converting millibars to inHg and want to force a two decimal place result, but everything I’ve read and tried from past forum posts wont work on my result. I don’t want the answer to my issue, I want to know if “toFixed” actually results in a result if the number you use is a mathematical expression that reconciles fine?

However, I know some of you will want to know what I’ve come up with so far. Here is the formula I’m using for this barometric pressure conversion:

(#ATM#*.02953)

this resolves to a result of exactly X # of inches of mercury but I can’t force the truncation of this result. So, sometimes I end up with 29.8500000000002 as my result (far too long for my field and not very practical). It seems to me the toFixed function should work on this, but it wont. This is why I ask: will toFixed reconcile with a mathematical expression, or is it broken/not designed that way?

Thanks!

2 Likes

Hi and welcome.
Made this faces to demonstrate the result of using toFixed on your formula.
Seems not broken. Hope it helps.

Greetings
Patrick

6 Likes

Yeah to Fixed is a fussy Beast . Especially with a Complex Formula . My Laptop is shut down so I can not test any thing . It does not work with one of the other new Tags.

2 Likes

Thank you sir! I see where I couldn’t grasp what the operator wanted. So, I was sniffing around the right tree, but didn’t find the walnut I needed to find! Thank you again for helping me find a solution! You are too kind!

5 Likes

Yeah I found it. You have to be very carefull if you use toFixed with Pad.

2 Likes

Can you advise me how to Inspect you face from you link. I try to post the stripped one.
.
.
OK I got it eventually.
I see you guaranteed toFixed to work with the Liberal use of Brackets. They cost nothing. Often made the difference.

2 Likes

Oh, try this one. Inspection should be on.

Or

2 Likes

@pbervoets I always post this one on here.
Click on the title to Inspect.
I am making a dope sheet on my Tablet not easy.


.
.

.
.
Carefully Delete ?draft=true

3 Likes