Results for “numeric”
Small, practical examples. Search by task or narrow things down below.
Clamp a value to a range
Use C++17 clamp to bound a numeric value.
C++✓ Tested
Convert text without raising a conversion error
Return NULL when a numeric conversion fails.
TRY_CONVERT✓ Tested
Extract part of a date
Read a calendar component with EXTRACT.
EXTRACT✓ Tested
Find the smallest value in a nonempty array
C: Initialize from the first element instead of assuming a numeric sentinel.
C✓ Tested
Format a timestamp with to_char
Produce a fixed numeric date string.
to_char✓ Tested
Generate a stepped sequence
Linux Commands: Use seq when a command pipeline needs a numeric sequence.
Linux Commands✓ Tested
Narrow a union using typeof
Handle text and numeric values with separate branches.
union✓ Tested
Pad a label with leading zeroes
PowerShell: Use a numeric format specifier to control the displayed width.
PowerShell✓ Tested
Read an integer from serial input
Arduino / C: parseInt skips leading nonnumeric characters and reads the next integer.
Arduino / C✓ Tested
Read named regex capture groups
JavaScript: Named groups make a fixed input format easier to inspect than numeric group positions.
JavaScript✓ Tested
Read named regex capture groups
TypeScript: Named groups make a fixed input format easier to inspect than numeric group positions.
TypeScript✓ Tested
Reject infinity and NaN
C#: Double.IsFinite distinguishes usable finite numeric inputs from special values.
C#✓ Tested