Numbers Utility
Numbers value operations. No hidden external Service communication.
Contract Numbers · 1.0.0-draft.1
Functions
integer
Checked integral conversion from a finite numeric value or base-ten string.
| Argument | Type | Required | Default |
|---|---|---|---|
| value | Numbers.Convertible | Yes | — |
Returns: core.integer
decimal
Decimal conversion from integer/decimal or finite base-ten string.
| Argument | Type | Required | Default |
|---|---|---|---|
| value | Numbers.Convertible | Yes | — |
Returns: core.decimal
text
Locale-independent numeric text without grouping.
| Argument | Type | Required | Default |
|---|---|---|---|
| value | core.numeric | Yes | — |
Returns: core.string
min
Numeric minimum/maximum; empty fails.
| Argument | Type | Required | Default |
|---|---|---|---|
| values | Numbers.Values | Yes | — |
Returns: core.numeric
max
Numeric minimum/maximum; empty fails.
| Argument | Type | Required | Default |
|---|---|---|---|
| values | Numbers.Values | Yes | — |
Returns: core.numeric
abs
Numeric absolute value; integer overflow fails.
| Argument | Type | Required | Default |
|---|---|---|---|
| value | core.numeric | Yes | — |
Returns: core.numeric
format
Fixed-place numeric string, using explicit rounding.
| Argument | Type | Required | Default |
|---|---|---|---|
| value | core.numeric | Yes | — |
| places | core.integer | Yes | — |
| rounding | core.string | Yes | — |
Returns: core.string
Behavior
- Conversions consume the complete base-ten string without whitespace or grouping. Integer conversion is checked against the signed 64-bit range.
- Calculations retain exact decimal digits. Overflow, invalid numeric input, empty min/max and required-but-unspecified rounding fail. Formatting uses explicit places and rounding.