cloudwego / cloudwego/sonic-rs

Can't get rust_decimal::arbitrary_precision to work

Open
#169 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
920
Forks
68
Avg merge
2h 5m
Merged PRs (30d)
1

Description

Serde_Json this returns value: 10.000,
Sonic_rs this returns value: 10

```rust
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};

fn main() {
let result: ArbitraryExample = sonic_rs::from_slice(b"{\"value\": 10.000}").unwrap();

dbg!(result);
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ArbitraryExample {
#[serde(with = "rust_decimal::serde::arbitrary_precision")]
value: Decimal,
}

```

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.