Decimal128
WASM-compatible Decimal128 implementation
Install / Use
/learn @mongodb-rust/Decimal128README
Installation
cargo add decimal128
Usage
This crate is a work-in-progress and does not have all applicable methods implemented as per IEEE Standard for Floating-Point Arithmetic and MongoDB Decimal128 BSON type. The following methods are currently implemented:
Decimal128.from_raw_bytesDecimal128.zeroDecimal128.is_nanDecimal128.is_negativeDecimal128.is_zeroDecimal128.to_string
use decimal128;
let vec: [u8; 16] = [
0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00,
];
let dec128 = Decimal128::from_raw_buf(vec);
let string = dec128.to_string();
assert_eq!("-Infinity".to_string(), string);
License
Licensed under the Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) at your option.
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
