Hwaro::Assets::Sass::Number
Inherits Hwaro::Assets::Sass::Value / Reference / Object
Constructors
new(value : Float64, unit : String = "", lexeme : String | Nil = nil)
SourceClass methods
format(value : Float64) : String
dart-sass-style number formatting: integers without a decimal point, floats rounded to 10 digits with trailing zeros trimmed.
Never routes through Float64#to_s, which switches to exponent
form outside roughly [1e-4, 1e16). CSS has no exponent syntax and
no Infinity/NaN literals, so 3.33333e-5px is not a number a
browser can read — it drops the whole declaration. Small values
are reachable from ordinary ratio math (opacity, scale).
Instance methods
compatible_unit?(other : Number) : Bool
v1 unit model: identical units or one side unitless. No px↔cm-style conversions.
eq?(other : Value) : Bool
Sass equality (==). Subclasses override; default is identity
on serialized text.
int_value(context : String) : Int32
Sourcelexeme
Original source spelling (".5em"); kept so uncomputed numbers serialize byte-identically.
result_unit(other : Number) : String
Sourceunit
Sourcevalue
Source