• jmcs@discuss.tchncs.de
    link
    fedilink
    English
    arrow-up
    6
    ·
    11 个月前

    It depends on the requirements of your app and what programming language you use. Sometimes you can get away with using a fixed precision that you can assume everywhere, but most common programming languages will have some implementation of a decimal type with variable precision if needed, so you won’t need to implement it on your own outside of university exercises.

    • Saleh@feddit.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 个月前

      Okay thank you. I was wondering because for stuff like buying electricity, gas or certain resources, parts etc. there is prices with higher precision in cents, but the precision would not be identical over all use cases in a large company.