demian-gg/pawn-humanize
Human-friendly number and color formatting library for Pawn
Instalar con sampctl
sampctl package install demian-gg/pawn-humanize
Ejecútalo en la carpeta de tu proyecto. sampctl descarga el paquete y sus dependencias.
Depende de 1 paquete
README.md
This utility library, inspired by go-humanize, provides a collection of functions that turn machine-friendly data into formats that are easier for humans to read and understand.
Whether you need to turn color codes into recognizable color names, display numbers with delimiters, convert numbers into words, or format numbers as ordinals, this library handles the little details that make your output feel natural and readable.
Installation
You can install the library either manually or using sampctl, depending on
your workflow:
Installing manually
1. Download the includes/humanize.inc file and place it in your server's
includes folder.
2. Then include it in your code and start using the library:
#include <humanize>
Installing via sampctl
1. Run the following command to install the library:
sampctl package install demian-gg/pawn-humanize
2. Then include it in your code and start using it:
#include <humanize>
Features
HumanizeColor()
0xA86420FF -> "Chocolate Brown"
0x42F44EFF -> "Lime Green"
0x137A8EFF -> "Teal"
HumanizeColor(color, dest[], maxLength = sizeof dest)
HumanizeNumberDelimited()
0 -> 0
100 -> 100
1000 -> 1,000
1000000 -> 1,000,000
-100000 -> -100,000
HumanizeNumberDelimited(number, dest[], maxLength = sizeof dest, delimiter[] = ",")
HumanizeNumberWords()
1000 -> "one thousand"
1234 -> "one thousand two hundred thirty-four"
-1234 -> "negative one thousand two hundred thirty-four"
HumanizeNumberWords(number, dest[], maxLength = sizeof dest)
HumanizeNumberOrdinal()
0 -> 0th
1 -> 1st
2 -> 2nd
3 -> 3rd
4 -> 4th
etc...
HumanizeNumberOrdinal(number, dest[], maxLength = sizeof dest)
License
This project is licensed under the MIT License. This license reflects our commitment to keeping the software open and accessible, while giving developers maximal freedom in how they use it. The MIT License is a permissive open-source license that allows anyone to use, modify, and distribute the software, including in commercial and closed-source projects, as long as the original copyright notice and license terms are preserved.
For more details, see LICENSE.md.
Esta página se genera con lo que GitHub publica sobre el repositorio. samp.directory no aloja el código. Informar de un problema con esta ficha