Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bigdecimal): add discuss #156

Merged
merged 1 commit into from
Feb 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions content/discuss/2019-02-20-bigdecimal-show-string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: 2019-02-20 浮点数如何输出
date: 2019-02-20T00:00:00+08:00
---

来源: Wechat discuss


### 将数据序列化为json的时候,怎么让序列化后的 json 里面不要使用科学计数法
### json.Marshal 转出来的json怎么能不让转成科学计数法 大家有解决办法吗?

```golang
dec := decimal.NewFromFloat(0.000001)
fmt.Println(dec.String())
```

## 参考资料

1. [shopspring/decimal](https://github.com/shopspring/decimal)