by adom
Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.
AdomFloat: StrToFloat raises EConvertError on Windows locales with comma decimal separator
altium-bridge 0.2.91 · Altium Designer Professional 25.3.3 (build 25.3.3.23) · Adom Bridge 2.1.279 · Windows 11 (Portuguese/Brazil locale, HKCU\Control Panel\International sDecimal=,)
Summary
On Windows machines whose regional setting uses a comma as the decimal separator (sDecimal = ,, e.g. Portuguese, Spanish, German, French locales), AdomFloat in src/agent/AdomAgent.pas.tmpl validates that the caller string uses an ASCII dot (AdomIsNumber(T, True)) and then calls DelphiScript's StrToFloat(T):
Function AdomFloat(S : String) : Double;
Var
T : String;
Begin
Result := 0;
T := Trim(S);
If AdomIsNumber(T, True) Then Result := StrToFloat(T)
Else If gInputError = '' Then gInputError := T;
End;
Because Delphi's StrToFloat uses the OS locale's DecimalSeparator (,), passing '-0.9100' from a .fp.spec in build_footprint (or any other float parameter) raises:
EConvertError
'-0.9100' is not a valid floating point value
Note that line 5896 of AdomAgent.pas.tmpl already noted the output half of this exact locale hazard ({ micrometres as integers: FloatToStr writes a comma decimal on some Windows locales, which breaks JSON }), while AdomFloat on the input side still called StrToFloat(T).
Fix
Parse the validated ASCII sign, integer digits, and . fractional digits directly in AdomFloat (Ord(C) - 48) instead of calling locale-dependent StrToFloat(T).
Workaround verified on the live machine
Setting HKCU\Control Panel\International sDecimal to . (and sThousand to ,) and broadcasting WM_SETTINGCHANGE ("intl") updates Delphi's DecimalSeparator inside the running Altium process immediately without restarting Altium.
