fmt_longlong(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ NAME ✨

fmt_longlong β€” write an ASCII representation of a long long integer πŸ’–

okay bestie, so this is the one that turns your big ol' long long number into actual readable text. no cap.


🌸 SYNTAX 🌸

#include <libowfat/fmt.h>

size_t fmt_longlong(char *dest,long long source);

like, that's the whole vibe. include the header, call the function, boom. 🫢


πŸ’… DESCRIPTION πŸ’…

so fmt_longlong writes an ASCII representation of source to dest β€” and when we say ASCII we mean literally just '-' and '0' to '9', base 10, the classic decimal glow-up. ✨

then it returns the number of bytes it wrote. that's your count, bestie. keep it.

one thing: fmt_longlong does not append \0. not a single null byte. she simply will not terminate your string for you. that's a you problem, and by you i mean please handle it. 😭

if dest equals FMT_LEN β€” which, iykyk, means it's zero β€” then fmt_longlong returns the number of bytes it would have written. it's giving window shopping. it's giving "just tell me how much it'd cost." πŸ’€

and for convenience, fmt.h defines the integer FMT_LONG to be big enough to contain every possible fmt_longlong output plus \0. so like. use that. she ate. πŸ‘‘

heads up: if you forget that \0 thing and just print dest raw, that's on you. the function is not gonna save you. periodt.

πŸ¦‹ SEE ALSO πŸ¦‹

  • scan_longlong(3) β€” the reverse girly. reads it back. the duo, fr fr. πŸŽ€

and that's the whole page!! written for the Library Functions Manual, filed under fmt_longlong(3) β€” mwah, slay, go format some integers bestie πŸ’œπŸŒˆβ­