1K instead of 1000
#9

PHP код:
// take this as parameters of your command like "/pay 100k"
new string[] = "100k";
// working on getting real amount
new amount strval(string);
if (
strfind(string"m"true) != -1) {
    
amount *= 1000000;
}
if (
strfind(string"k"true) != -1) {
    
amount *= 1000;
}
// result
printf("amount is $%i"amount); 
Nobody writes like "100k100k", the abbreviations are always in the end like "100k", "100m". So this is the easiest and fastest approach i posted.
Reply


Messages In This Thread
1K instead of 1000 - by AzaMx - 13.08.2018, 13:26
Re: 1K instead of 1000 - by CodeStyle175 - 13.08.2018, 13:41
Re: 1K instead of 1000 - by jlalt - 13.08.2018, 14:08
Re: 1K instead of 1000 - by AzaMx - 14.08.2018, 09:14
Re: 1K instead of 1000 - by OneDay - 14.08.2018, 10:47
Re: 1K instead of 1000 - by AzaMx - 14.08.2018, 21:54
Re: 1K instead of 1000 - by Crystallize - 15.08.2018, 00:34
Re: 1K instead of 1000 - by AzaMx - 15.08.2018, 03:24
Re: 1K instead of 1000 - by Gammix - 15.08.2018, 09:19
Re: 1K instead of 1000 - by AzaMx - 16.08.2018, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)