Originally posted by DamianReeves July 10, 2025
Floats are not ideal for monetary calculations as they are not precise. It would be beneficial if Pkl included a decimal type to help with not only specifying decimal types, (which is fairly easy to do), but also providing decimal mathematics (which is a bit more difficult to get right on the user side).
Originally created by @HT154 on GitHub (Jul 10, 2025).
### Discussed in https://github.com/apple/pkl/discussions/1119
<div type='discussions-op-text'>
<sup>Originally posted by **DamianReeves** July 10, 2025</sup>
Floats are not ideal for monetary calculations as they are not precise. It would be beneficial if Pkl included a decimal type to help with not only specifying decimal types, (which is fairly easy to do), but also providing decimal mathematics (which is a bit more difficult to get right on the user side).</div>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @HT154 on GitHub (Jul 10, 2025).
Discussed in https://github.com/apple/pkl/discussions/1119
Originally posted by DamianReeves July 10, 2025
Floats are not ideal for monetary calculations as they are not precise. It would be beneficial if Pkl included a decimal type to help with not only specifying decimal types, (which is fairly easy to do), but also providing decimal mathematics (which is a bit more difficult to get right on the user side).
@odenix commented on GitHub (Aug 14, 2025):
An important aspect of monetary calculations are rounding modes and how/where they are specified.