FIND YOUR NEXT FEW LINES

Results for “code”

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

3000 snippets foundClear filters
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
GoDates & times

Format a UTC timestamp

Format a UTC timestamp using a complete Go program with explicit sample inputs.

Go✓ Tested
Linux CommandsDates & process utilities

Format a zero-padded numeric label

Linux Commands: Use printf formatting instead of concatenating a variable number of zeroes.

Linux Commands✓ Tested
AngularPipes & formatting

Format an amount in a selected currency

Format an amount in a selected currency with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
RustParsing & byte data

Format an integer as padded hexadecimal

Format an integer as padded hexadecimal in a complete Rust program using the standard library.

Rust✓ Tested
C++Numeric parsing & calculations

Format an integer into a caller-owned buffer

C++: to_chars avoids allocation and reports whether the buffer was large enough.

C++✓ Tested
JavaScriptFiles & async

Format an ISO date

Format a UTC JavaScript Date deterministically.

JavaScript✓ Tested
C++Numbers & algorithms

Format decimal output

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

C++✓ Tested
Arduino / CText & bounded buffers

Format several integers in a fixed buffer

Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.

Arduino / C✓ Tested
AngularPipes & formatting

Format text in lowercase

Format text in lowercase with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
AngularGetting Started

Format text through a built-in pipe

Format text through a built-in pipe with a standalone Angular component and explicit browser behavior.

Angular✓ Tested