2 public import static "ecere"
9 static void _WorkAround()
12 a.OnGetDataFromString(null);
14 extern int __ecereVMethodID_class_OnGetDataFromString;
18 public class Currency : double
20 char * OnGetString(char * tempString, void * fieldData, bool * needClass)
26 bool firstGroup = true;
28 sprintf(number, "%.2f", this);
31 sprintf(tempString, "$ ");
35 tempString[pos++] = '-';
40 int numDigits = len - c - 3;
45 numDigits = (len - c - 3) % 3;
46 if(!numDigits) numDigits = 3;
52 memcpy(tempString + pos, number + c, numDigits);
57 tempString[pos++] = ',';
59 strcpy(tempString + pos, number + c);
63 bool OnGetDataFromString(char * string)
67 char number[256] = "";
71 for(c = 0; (ch = string[c]) && !isdigit(ch) && ch != '.'; c++);
72 for(; (ch = string[c]) && (isdigit(ch) || ch == '.' || ch == ',' || ch == ' '); c++)
74 if(ch != ',' && ch != ' ')
76 if(ch == '.') gotDot = true;
85 return ((bool (*)(void *, void *, const char *))(void *)class(double)._vTbl[__ecereVMethodID_class_OnGetDataFromString])(class(double), &this, number);