garrysmod icon indicating copy to clipboard operation
garrysmod copied to clipboard

Added string.NiceNumber() to abbreviate large numbers

Open SnisnotAl opened this issue 2 years ago • 5 comments

Added string.NiceNumber() to abbreviate large numbers Examples:

string.NiceNumber( 69420 ) --> "69.42K"
string.NiceNumber( -123456789 ) --> "-123.46M"

SnisnotAl avatar Apr 10 '22 17:04 SnisnotAl

Are you sure double can represent the number with the largest suffix?

GitSparTV avatar Apr 10 '22 18:04 GitSparTV

im not sure i understand? there is no need to store the whole number because it will be rounded significantly anyway it works up to 1e+89 until it starts just adding 0's before the last prefix image

SnisnotAl avatar Apr 10 '22 18:04 SnisnotAl

It seems feature-less, perhaps being able to define the character(s) used etc. for it might be a good idea.

NoSharp avatar Apr 16 '22 18:04 NoSharp

It seems feature-less, perhaps being able to define the character(s) used etc. for it might be a good idea.

those characters are the well-known standard which almost everything uses

Ffyvjgnmmm avatar Apr 17 '22 01:04 Ffyvjgnmmm

It seems feature-less, perhaps being able to define the character(s) used etc. for it might be a good idea.

those characters are the well-known standard which almost everything uses

This does not work well together with localized content.

Grocel avatar Mar 08 '24 22:03 Grocel