ISibboI / evalexpr

A powerful expression evaluation crate 🦀.
GNU Affero General Public License v3.0
325 stars 54 forks source link

Support for calculations using a decimal type? #115

Open tirithen opened 2 years ago

tirithen commented 2 years ago

I have been experimenting a bit with this crate for a project that I'm working on, and I wonder, is there a way to perform all calculations using a decimal numeric type, like rust_decimal or similar, rather than a floating point type?

This as some use cases needs to be able to guarantee the exact the precision of calculations.

ISibboI commented 2 years ago

For now you would need make a fork and then alter the type alias for the decimal type. But I am planning to make the integer and decimal types generic at some point, see #111. However, at the moment I don't have much time for this crate.

tirithen commented 2 years ago

Thank you for the answer, I might give that a try.

It looks promising with being able to choose the decimal type at compile time as discussed in the other issue.