FIND YOUR NEXT FEW LINES

Results for “Form behavior”

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

1212 snippets foundClear filters
CNumbers & memory

Format a decimal value

Print two fractional digits with C printf.

C✓ Tested
CBinary formats & structured parsing

Format a known timestamp in UTC

C: gmtime converts to UTC calendar fields and strftime formats them.

C✓ Tested
Linux CommandsDates & process utilities

Format a known UTC timestamp

Linux Commands: Use GNU date -u and an explicit input offset to avoid local timezone dependence.

Linux Commands✓ Tested
CBinary formats & structured parsing

Format a nonnegative integer amount as whole and fractional units

C: Keep the calculation in integer minor units and use two digits for the remainder.

C✓ Tested
Bash ScriptsText parsing & arithmetic

Format a numeric label with leading zeroes

Bash Scripts: Use a constant printf format string and supply values as separate arguments.

Bash Scripts✓ Tested
GoGetting Started

Format a readable status message

Format a readable status message using a complete Go program with explicit sample inputs.

Go✓ 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
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
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