FIND YOUR NEXT FEW LINES

Results for “Numeric parsing & calculations”

Small, practical examples. Search by task or narrow things down below.

232 snippets foundClear filters
C++Numbers & algorithms

Clamp a value to a range

Use C++17 clamp to bound a numeric value.

C++✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
C#JSON & binary formats

Decode hexadecimal bytes

C#: FromHexString and ToHexString handle binary data without manually parsing pairs of characters.

C#✓ Tested
PostgresDates & series

Extract part of a date

Read a calendar component with EXTRACT.

EXTRACT✓ Tested
CArray transformations

Find the smallest value in a nonempty array

C: Initialize from the first element instead of assuming a numeric sentinel.

C✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
Linux CommandsDates & process utilities

Generate a stepped sequence

Linux Commands: Use seq when a command pipeline needs a numeric sequence.

Linux Commands✓ Tested
JavaEncoding & structured values

Inspect components of a URI

Java: Use URI parsing instead of splitting a URL at punctuation manually.

Java✓ Tested
GitMerging & replaying changes

List the paths with unresolved merge conflicts

Git: The U diff filter identifies unmerged entries without parsing human-readable status output.

Git✓ Tested
TypeScriptTypes & functions

Narrow a union using typeof

Handle text and numeric values with separate branches.

union✓ Tested
PowerShellStrings & literal text

Pad a label with leading zeroes

PowerShell: Use a numeric format specifier to control the displayed width.

PowerShell✓ Tested