Skip to main content

fmt_int

Function fmt_int 

Source
pub fn fmt_int(value: i64) -> String
Expand description

Spell an integer the way the writers do: through the signed 32-bit view, so a stored 4294967295 writes as -1.

use pdfrum_object::fmt_int;

assert_eq!(fmt_int(1234), "1234");
assert_eq!(fmt_int(-54321), "-54321");
assert_eq!(fmt_int(4_294_967_295), "-1");