#utf-8 #str #f32 #no-std

no-std embedded_cotoutf8

COTO is a library that translates numerical primitives into readable ASCII UTF-8 arrays

5 releases

new 0.1.5 Nov 21, 2024
0.1.4 Nov 21, 2024
0.1.3 Oct 18, 2024
0.1.1 Aug 21, 2024
0.1.0 Jun 26, 2024

#277 in Embedded development

Download history 114/week @ 2024-08-15 43/week @ 2024-08-22 17/week @ 2024-09-12 7/week @ 2024-09-19 4/week @ 2024-09-26 121/week @ 2024-10-03 62/week @ 2024-10-10 129/week @ 2024-10-17 5/week @ 2024-10-24 4/week @ 2024-10-31 5/week @ 2024-11-07

145 downloads per month

MIT license

16KB
354 lines

Embedded-COTOutf8

crates.io

LOGO

COTO is derived from the Gujarati word કોતો, meaning 'engrave.' It refers to a concept where data sizes are fixed. COTO is a library that translates numerical primitives into readable ASCII UTF-8 arrays.

Example󰙨

Convert primitives data type to specific Byte(character) array for str

    // for i8
    let num: i8 = -127;
    let binding = num.coto_utf8();
    let result = core::str::from_utf8(&binding).unwrap();
    assert_eq!(result, "-127")
    // for f32
    let num: f32 = 1524.001;
    let binding = num.coto_utf8();
    let result = core::str::from_utf8(&binding).unwrap();
    println!("{}", result); // OUTPUT:` 1524.024`

Debug or Display for ufmt By default ufmt feature enabled or fmt

    let num = DebugODisplay(44245.12f32);
    println!("{}", num);
    ufmt::uwriteln!(serial, "{}", num); // for ufmt

implemented for i8,i16,132,i64,u8,u16,u32,f32,f64

Dependencies

~1.5MB
~38K SLoC