Skip to main content

num_to_string

Function num_to_string 

Source
pub fn num_to_string(n: Num) -> String
Expand description

Lua number → text. Integers print as integers. Floats print with shortest round-trip digits (the 5.5 “read back correctly” rule) in C %g-style presentation: scientific form when the decimal exponent falls outside [-4, 14), two-digit signed exponent, and .0 appended to integral-looking decimals (PUC lua_number2str). Exact boundary alignment against PUC 5.5 output is rechecked by the P04 gate (strings/math suites).