FIND YOUR NEXT FEW LINES

Results for “Dates & precise numbers”

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

184 snippets foundClear filters
C++Numbers & algorithms

Find the largest value

Check for an empty C++ vector before dereferencing max_element.

C++✓ Tested
C#Data & dates

Format a decimal amount

Use invariant culture to print a C# decimal with two places.

C#✓ Tested
CNumbers & memory

Format a decimal value

Print two fractional digits with C printf.

C✓ Tested
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
PostgresDates & series

Format a timestamp with to_char

Produce a fixed numeric date string.

to_char✓ Tested
C++Numbers & algorithms

Format decimal output

Use fixed and setprecision to print two C++ decimal places.

C++✓ Tested
Arduino / CGetting Started

Give an LED pin a constant name

Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.

Arduino / C✓ Tested
C++Tasks & synchronization

Increment a shared counter safely

C++: Atomic increments prevent lost updates when two threads change the same counter.

C++✓ Tested
SQL ServerDates & text

Join rows in a chosen order

Aggregate text with STRING_AGG and WITHIN GROUP.

STRING_AGG✓ Tested
PythonStrings & dates

Join strings with a separator

Combine a list of strings into one readable string with a separator between each item.

string✓ Tested
Bash ScriptsProcesses & environment

Keep loop state by avoiding a pipeline subshell

Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.

Bash Scripts✓ Tested
PostgresWindows & text

Number rows within each group

Assign ordered row numbers with a window function.

row_number✓ Tested