Convert string with commas to float

前端 未结 9 1992
走了就别回头了
走了就别回头了 2021-02-19 18:58

Is there a built-in Delphi function which would convert a string such as \'3,232.00\' to float? StrToFloat raises an exception because of the comma. Or is the only way to stri

9条回答
  •  闹比i
    闹比i (楼主)
    2021-02-19 19:22

    I had the same problem when my Users need to enter 'scientific' values such as "1,234.06mV". Here there is a comma, a multiplier (m=x0.001) and a unit (V). I created a 'wide' format converter routine to handle these situtations. Brian

提交回复
热议问题