com Float
Pessoal.. estava somando valores com casas decimais e multiplicando e etc.. todos tranfosmados de string para float
Tudo normal até quando o número passa de 999,99
Apartir do momento que é feita uma operação com ele transformado.. ele dá erro:
"1.500,00 (ou otro numero acima de 1.000)" is not a valid floating point value.
procedure Tform1.contaTotal; var i : integer; soma : real;begin soma := soma - strtofloat(txtdesc.Text); soma := soma + strtofloat(txtacr.Text); soma := soma + strtofloat(txttaxa.Text); if list.Items.Count = 0 then txtvalTotal.Text := floattostr(soma); for i := 0 to list.Items.Count -1 do begin soma := soma + strtofloat(removec2(list.Items[i].SubItems[5])); end; txtvalTotal.Text := FloatToStr(soma);end;
alguem pode me ajudar?? lembrando que o valor do ListView ali foi trasformado assim:
varval : real;qntd : string;beginwith List.Items.Add do begin Caption := IntToStr(list.items.count-1); SubItems.Add(rs.Fields['id'].Value); SubItems.Add(txtdescp.Text); SubItems.Add(rs.Fields['un'].Value); if txtqntdp.Text = '' then begin qntd := '0'; end else begin qntd := txtqntdp.Text; end; SubItems.Add(FormatFloat('##,###,##0.000', strtofloat(qntd))); SubItems.Add(FormatFloat('##,###,##0.000', strtofloat(txtvalP.Text))); val := strtofloat(txtvalP.Text) * strtofloat(qntd); SubItems.Add(FormatFloat('##,###,##0.000', val)); end;contaTotal;
[http://forum.imasters.com.br/public/style_emoticons/](http://forum.imasters.com.br/public/style_emoticons/)default/thumbsup.gifDiscussão (2)
Carregando comentários...