brabo-hi

    brabo-hi

    1 year ago
    how should we handle BigDecimal and monetary values in KMM ?
    e

    ephemient

    1 year ago
    until that is resolved, I'd do fixed-point manually for monetary units. Int + fixed offset of 2 should cover modern currencies and most reasonable values. Long + fixed offset of 8 will cover all Satoshis that can possibly exist. should be fine unless you're trying to express the world GDP in units of ZWL or something extreme like that
    brabo-hi

    brabo-hi

    1 year ago
    thanks @ephemient
    m

    Mike

    1 year ago
    I use expect / actual to do this, for example on android I use actual implementation of BigDecimal
    e

    ephemient

    1 year ago
    you can do that, and there's polyfill support for the JS decimal proposal as well, but on native you'll have to pull in something like GMP or OpenSSL/bn