pub struct Numeric(pub String);Expand description
NUMERIC/DECIMAL type (stored as string for precision)
Tuple Fields§
§0: StringImplementations§
Source§impl Numeric
impl Numeric
Sourcepub fn to_f64(&self) -> Result<f64, ParseFloatError>
pub fn to_f64(&self) -> Result<f64, ParseFloatError>
Parse as f64 (may lose precision for very large numbers)
Sourcepub fn to_i64(&self) -> Result<i64, ParseIntError>
pub fn to_i64(&self) -> Result<i64, ParseIntError>
Parse as i64 (truncates decimal part)
Sourcepub fn to_i64_exact(&self) -> Result<i64, ParseIntError>
pub fn to_i64_exact(&self) -> Result<i64, ParseIntError>
Parse as i64 only when the numeric value has no non-zero decimal part.
Sourcepub fn is_integral(&self) -> bool
pub fn is_integral(&self) -> bool
Whether the decimal representation has no non-zero fractional digits.
Trait Implementations§
impl StructuralPartialEq for Numeric
Auto Trait Implementations§
impl Freeze for Numeric
impl RefUnwindSafe for Numeric
impl Send for Numeric
impl Sync for Numeric
impl Unpin for Numeric
impl UnsafeUnpin for Numeric
impl UnwindSafe for Numeric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more