brandon-patterson / chemist

A virtual lab assistant
MIT License
0 stars 0 forks source link

add basic significant figure calculations #33

Closed brandon-patterson closed 4 years ago

brandon-patterson commented 4 years ago

resolves #31

This definitely got more out of hand than I initially intended.

The main points of complexity are that:

I was hoping that there would be a character for an underlined "0", but there isn't, so in cases where we need to mark a zero as the least significant place, I've subbed in <u>0</u> for now. It sounds like we should be able to interpret the html in the text element that gets displayed on screen.

There are definitely some ugly things going on here, so no guarantees that this works perfectly. Feel free to play around with it if you can think of test cases that I've left out. Also, let me know if anything is particularly hard to read and I can see about clarifying it.

zspatter commented 4 years ago

This is far more complicated than I would have expected. I looked into some alternative solutions, but none seem to tackle the whole problem of representing the appropriate sig figs in this context.