DecimalSeparator

    Date: 03/07/08 (Code WTF)    Keywords: no keywords

    Леминги...

    Function SetMoney(Money:double):string;
    var
      res : string;
      I   : Integer;
    begin
      Result := '';
      res := FloatToStr(Money);
      for i := 1 to length(res) do
      begin
          if (res[i]='0') or
             (res[i]='1') or
             (res[i]='2') or
             (res[i]='3') or
             (res[i]='4') or
             (res[i]='5') or
             (res[i]='6') or
             (res[i]='7') or
             (res[i]='8') or
             (res[i]='9')
           then begin
                Result:=Result+res[i];
                end
           else if res[i] = '-' then
            begin
              Result:=Result+'-';
            end else
              begin
                Result:=Result+'.';
              end;
          end;
    end;

    Source: http://community.livejournal.com/code_wtf/124566.html

« глобализация... || switch »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home