-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0286ae
commit ab1daf8
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |