0

so, this question here states that removing trailing zeros is a bug... but what if I want that behavior? Is there a way to set this?

input (decimal): 1.99000

should be

output (json): 1.99
aloisdg
  • 22,270
  • 6
  • 85
  • 105
Leonardo
  • 10,737
  • 10
  • 62
  • 155
  • use the version with the bug, and don't upgrade?? – ADyson Apr 19 '18 at 14:35
  • not an option... anyone could upgrade this and simply forget to check the serialization of a handful of edge cases – Leonardo Apr 19 '18 at 14:37
  • this is a real throw in the air and hope idea, but can you do a setter that takes string and a getter that produces a decimal and drop trailing 0s as part of a string? – BugFinder Apr 19 '18 at 14:40
  • @Leonardo I updated the post which yours is near enough to be a duplicate, with an alternative answer. Hope one or the other will help you. – aloisdg Apr 19 '18 at 14:57
  • @Leonardo isn't that what documentation of your project, and team knowledge, is for? I agree it's a risk, it's probably a lot easier than implementing / overriding a serialiser yourself - unless the scenario mentioned in the duplicate works for you. – ADyson Apr 19 '18 at 15:37

0 Answers0