We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 796b9ce commit 734b34dCopy full SHA for 734b34d
src/lib.rs
@@ -156,13 +156,16 @@ impl BigDecimal {
156
157
/// Creates and initializes a `BigDecimal`.
158
///
159
+ /// Decodes using `str::from_utf8` and forwards to `BigDecimal::from_str_radix`.
160
+ /// Only base-10 is supported.
161
+ ///
162
/// # Examples
163
164
/// ```
165
/// use bigdecimal::{BigDecimal, Zero};
166
167
/// assert_eq!(BigDecimal::parse_bytes(b"0", 10).unwrap(), BigDecimal::zero());
- /// // assert_eq!(BigDecimal::parse_bytes(b"f", 16), BigDecimal::parse_bytes(b"16", 10));
168
+ /// assert_eq!(BigDecimal::parse_bytes(b"13", 10).unwrap(), BigDecimal::from(13));
169
170
#[inline]
171
pub fn parse_bytes(buf: &[u8], radix: u32) -> Option<BigDecimal> {
0 commit comments