![](https://poptalk.scrubbles.tech/pictrs/image/e9507f30-d29f-46a1-ae06-6857fbcf9701.png)
![](https://lemmy.ml/pictrs/image/c0ed0a36-2496-4b4d-ac77-7d2fd7f2b5b7.png)
Correct, JSON can handle any precision, because it’s just dumped as a string anyway, just not enclosed in the ""
. However, as you mentioned, as soon as it comes through the parser it’ll put it into an underlying float value. In C# I create a save high precision attribute that will take the value and put it directly into a decimal
. In JS I’m sure there’s some way to do that, but that parser is way less extensible compared to C#. However, this also all assumes you know the client will parse it correctly, overriding the default behavior. Safest is to just send it as a string, and then create your parsers to automatically send to and from strings
Yeah idk. I get what they’re saying completely, but this exact one seems easy. Just do a validation check and throw an error. I mean, it is an IP validator after all. Either support hex or don’t.