Package dev.frostlake.functions.scalar
Class SnowflakeNumberFormat
java.lang.Object
dev.frostlake.functions.scalar.SnowflakeNumberFormat
Formats a numeric value with Snowflake's SQL number format model (used by TO_CHAR / TO_VARCHAR
with a numeric format string), matching the live-verified output shape: the result is
RIGHT-ALIGNED to the template width plus one leading sign position (blank for positive, a
floating
- for negative, +/- with a leading S); MI moves
the sign to a trailing position (- or blank) with no leading sign slot; a $
floats between the sign and the digits; 0 placeholders zero-pad; trailing fractional
9 positions render insignificant zeros as spaces (0.5 with '99.99' is
" 0.5 "); a value wider than the integer template renders # across the template
width; FM strips all of that padding. Rounding is HALF_UP to the fractional placeholders.
The PR keyword is NOT part of Snowflake's model and raises the same error Snowflake
raises (live-verified). Not modeled: EEEE scientific notation and locale currency codes.-
Method Summary
-
Method Details
-
format
-