Bjr à vous,
sous Delphi Sydney Community pour Android:
StrToFloat() retourne toujours zéro. Problème de locales ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 function ConvertirEnNombreReel(const S: string; const Default: double; const DoDebug: boolean = false): double; var st: String; begin ST := Trim(S); GetLocaleFormatSettings(0, FormatSettings); //FormatSettings.DecimalSeparator := ','; Result := StrToFloatDef(ST, Default, FormatSettings); // retourne toujours la valeur alternative Default, souvent mise à zéro end;
Partager