SA-MP Forums Archive
[Include] Humanize - A human-friendly Pawn library - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Humanize - A human-friendly Pawn library (/showthread.php?tid=657062)



Humanize - A human-friendly Pawn library - Codeah - 30.07.2018

Humanize
Description

Humanize is a library that makes stuff computers can read easily, more readable for humans.

Features

Thousands Seperators
Код:
0 -> 0
100 -> 100
1000 -> 1,000
1000000 -> 1,000,000
-100000 -> -100,000
Код:
HumanizeThousand(integer, dest[], maxLength = sizeof dest, delimiter[] = ",")
Colors
Код:
0xA86420FF -> "Chocolate Brown"
0x42F44EFF -> "Lime Green"
0x137A8EFF -> "Teal"
Код:
HumanizeColor(color, dest[], maxLength = sizeof dest)
Numbers to words
Код:
1000 -> "one thousand"
1234 -> "one thousand two hundred thirty-four"
-1234 -> "negative one thousand two hundred thirty-four"
Код:
HumanizeNumber(number, dest[], maxLength = sizeof dest)
Ordinals
Код:
0 -> 0th
1 -> 1st
2 -> 2nd
3 -> 3rd
4 -> 4th
etc...
Код:
HumanizeOrdinal(number, dest[], maxLength = sizeof dest)
Install / Download

You can find all releases here.

Alternatively, you can simply install Humanize to your project using SampCTL.
Код:
sampctl package install thecodeah/pawn-humanize
Include in your code and begin using the library:
Код:
#include <humanize>
Issues / Suggestions

Please leave suggestions and report issues on Github.


Re: Humanize - A human-friendly Pawn library - iAmir - 31.07.2018

nice one


Re: Humanize - A human-friendly Pawn library - Verc - 07.08.2018

Thank you! This will make my job easier!