Rounding pressure to 3 decimal places

I have the following expressions to give me the barometric pressure in both hPa and inHg.

((round(#ATM#)*.030)) In Hg

((round(#ATM#))) hPa

These values are frequently displaying with somewhere around 15 decimal places.

I’ve tried wrapping them in (floor), but I must be doing it wrong, particularly with inHg

This seems to work fine for hPa (floor(#ATM#*1000)/1000) hPa
But no matter what I try, inHg still has insane decimal places

2 Likes

I’ve not used this much. I don’t remember where I found it here in the community, but this is all I’ve got for you.

(round(#ATM# * 0.02953))

It’s worth a shot.

2 Likes

Then

((round(((#ATM#)*.02953)*1000))/1000)

for 3 decimal places.

No Problem with loads of Parentheses but they have to be put in the right place Little Devils.

3 Likes

That got me to zero decimal places, which is far better than 15!

1 Like

That did the trick, thank you!

1 Like

OK, I see what you did, so I tried ((round(((#ATM#) * .02953) * 10))/10) and it gives just one decimal place. :grin:

2 Likes

I know there are other ways to do these things. I like Matties Idea that the maths should explain itself. Some times I just POG arround till it works. In that case nothing explains itself to anyone.

3 Likes

I like being able to deconstruct the math - it helps me understand it at a deeper level and correct my own mistakes.

2 Likes

@russellcresser @kd7eir

I’ve never been one to be able to go and do the math from scratch, but I can figure out what it’s doing and learn how to edit it and make it do exactly what I want…Some of the time!

2 Likes

Knowing what to tweek is its own understanding of the Maths. Remembering stuff is half the problem. Having said that I am surprised how much I am remembering. But I have been at it for two years now :::)))

1 Like

I take a lot of notes. This is a screen shot of my folder with my Facer notes text files. You’ll notice there are two more sub folders with even more notes.

3 Likes

Yeah. I have started a favourite Tags File. I will share it when I am Happy with it. But I really must get some folders going. It is all getting a bit messy :::)))

3 Likes

I have several tabs opened in Notepad++ with things I’ve learned from all of you. Maybe someday I’ll be smart enough to actually save the tabs…

3 Likes

My issue is always needing the expression that someone posted on the community sometime but not remembering which post it was in or exactly the way the expression was done. I got tired of hunting and one day I started searching for posts and when I would find something useful, I put it in a text file. Then later I figured out I need to note where I had found them so I could credit the poster when I reposted it to answer someone’s question. Live and learn, I guess…

UPDATE: I did a search an found the expression (#ATM# * 0.02953) posted by @mikeoday in the post Barometric pressure conversion from Hpa to inHg? So, I don’t know if I figured out to add the round function or if I seen it somewhere else. Mike’s answer was in a post dated Oct 2019 so it’s been WAY to long for me to remember now.

4 Likes