Elektrine lite

← Feed

@silverpill@mitra.social

Post #2909167

2026-03-15 17:31 UTC

@sabrinkmann@hachyderm.io @grindhold@23.social It looks like the value is not required to be a string. However, it is a string in all examples, and my implementation also treats it as a string. I probably did that to avoid losing precision and to support very big numbers. In some programming languages, the float type is lossy (Python?), and in some the integer type has a relatively low maximum value (JavaScript?). Since precision is very important for currency amounts, and they can get quite big (for example, there is a popular cryptocurrency that can be divided into 10^18 units), I always serialize them as strings, to avoid issues during deserialization.

Replies (0)

No replies.