Needing money translate function
#1

Hi mates,i need a func. that translates entered integer value to money,example : entry: 50000,return : 50.000
I mean,i want something that can write dots
Reply
#2

O.K,i found it.Credits goes to RyDeR.
Код:
stock convertNumber(value)
{
   new
      string[24]
   ;
   format(string, sizeof(string), "%d", value);
   
   for(new i = (strlen(string) - 3); i > (value < 0 ? 1 : 0) ; i -= 3)
   {
       strins(string[i], ".", 0);
   }
   return string;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)