Human readable numbers
#1

There was a function that made a number into a string , delimiting each 3 digits with a dot (.)

For example

1500 will turn intro 1.500 || 15000 will tun into 15.000

Can any1 give me this function ?
Reply
#2

It should be commas, not periods.

https://www.******.co.uk/search?q=samp+number+commas
Reply
#3

pawn Code:
stock Comma(numbers)
{
    new temp[24],counter = -1;
    valstr(temp,numbers);
    for(new i = strlen(temp);i > 0; i--)
    {
        counter++;
        if(counter == 3)
        {
            strins(temp,",",i);
            counter = 0;
        }
    }
    return temp;
}
Use this to a number to put dots ..
pawn Code:
Comma(WhateverNumbers);
Reply
#4

Ty ,it works
Reply
#5

Officially "Human readable numbers" (which by the way is an awful name to give to unseparated numbers, because they are readable by most of the people) are to be separated by spaces, not commas/dots.

One space every three numbers (thousands), except if you don't have three numbers (hundreds): 4 500 000 000 ; 250 200 054 ; 332 000 000 000 ; 3 457 456 124 579 ; 250 000

SI (International System of Units):
Quote:

Spaces should be used as a thousands separator (1 000 000) in contrast to commas or periods (1,000,000 or 1.000.000) to reduce confusion resulting from the variation between these forms in different countries.

Reply
#6

Quote:
Originally Posted by CuervO
View Post
Officially "Human readable numbers" (which by the way is an awful name to give to unseparated numbers, because they are readable by most of the people) are to be separated by spaces, not commas/dots.

One space every three numbers (thousands), except if you don't have three numbers (hundreds): 4 500 000 000 ; 250 200 054 ; 332 000 000 000 ; 3 457 456 124 579 ; 250 000

SI (International System of Units):
99% of people would use and expect commas.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)