Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 6481e1a

Browse files
author
Julius de Bruijn
committed
The JSON representation of a BigDecimal should be string
1 parent 93fca29 commit 6481e1a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ast/values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<'a> From<Value<'a>> for serde_json::Value {
180180
v.map(|v| serde_json::Value::Array(v.into_iter().map(serde_json::Value::from).collect()))
181181
}
182182
#[cfg(feature = "bigdecimal")]
183-
Value::Numeric(d) => d.map(|d| serde_json::to_value(d.to_f64().unwrap()).unwrap()),
183+
Value::Numeric(d) => d.map(|d| serde_json::Value::String(d.to_string())),
184184
#[cfg(feature = "json")]
185185
Value::Json(v) => v,
186186
#[cfg(feature = "uuid")]

0 commit comments

Comments
 (0)