google / google/gson

ability to use stripTrailingZeros in BigDecimal representation

Open
#615 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
24.2k
Forks
4.5k
Avg merge
6d 4h
Merged PRs (30d)
12

Description

```
Our JSON messages currently contain a lot of zeros, that are redundant for our
purposes, because BigDecimal objects include those zeros in their
serialization. I understand why those zeros should be preserved by default,
but it would be great if there was a way to remove them. It seems like a
configuration option, that controls the invocation of the BigDecimal
stripTrailingZeros() method, would be perfect.

We could use a type adapter. However, it appears impossible to serialize raw
text. The BigDecimal objects would have to be serialized with double quotes,
but we're trying to trim things down as much as possible.
```

Original issue reported on code.google.com by `samuel.j...@gmail.com` on 15 Dec 2014 at 11:24

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.