• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Library] Humanize - A human-friendly Pawn library
#1
Rainbow 
Humanize

Description



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



Features



Thousands Seperators



Code:
0 -> 0

100 -> 100

1000 -> 1,000

1000000 -> 1,000,000

-100000 -> -100,000

Code:
HumanizeThousand(integer, dest[], maxLength = sizeof dest, delimiter[] = ",")



Colors

Code:
0xA86420FF -> "Chocolate Brown"

0x42F44EFF -> "Lime Green"

0x137A8EFF -> "Teal"

Code:
HumanizeColor(color, dest[], maxLength = sizeof dest)



Numbers to words

Code:
1000 -> "one thousand"

1234 -> "one thousand two hundred thirty-four"

-1234 -> "negative one thousand two hundred thirty-four"

Code:
HumanizeNumber(number, dest[], maxLength = sizeof dest)



Ordinals

Code:
0 -> 0th

1 -> 1st

2 -> 2nd

3 -> 3rd

4 -> 4th

etc...

Code:
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.

Code:
sampctl package install thecodeah/pawn-humanize

Include in your code and begin using the library:

Code:
#include <humanize>



Issues / Suggestions



Please leave suggestions and report issues on Github.
  Reply


Messages In This Thread
Humanize - A human-friendly Pawn library - by Codeah - 2019-04-11, 04:08 PM

Forum Jump: