diff --git a/rtl/inc/compproc.inc b/rtl/inc/compproc.inc index ec594767fe..a259db235d 100644 --- a/rtl/inc/compproc.inc +++ b/rtl/inc/compproc.inc @@ -105,9 +105,11 @@ procedure fpc_WideStr_uint(v : valuint;Len : SizeInt; out S : WideString); compi {$endif CPU64} {$ifdef FPC_HAS_FEATURE_WIDESTRINGS} procedure fpc_WideStr_Float(d : ValReal;len,fr,rt : SizeInt;out s : WideString); compilerproc; +procedure fpc_WideStr_Currency(c : Currency;len,fr : SizeInt;out s : WideString);compilerproc; {$endif FPC_HAS_FEATURE_WIDESTRINGS} procedure fpc_chararray_Float(d : ValReal;len,fr,rt : SizeInt;out a : array of char); compilerproc; +procedure fpc_chararray_Currency(c : Currency;len,fr : SizeInt;out a : array of char);compilerproc; { Val() support } Function fpc_Val_Real_ShortStr(const s : shortstring; out code : ValSInt): ValReal; compilerproc; @@ -124,6 +126,7 @@ Function fpc_Val_Currency_AnsiStr(Const S : AnsiString; out Code : ValSInt): Cur Function fpc_Val_Real_WideStr(Const S : WideString; out Code : ValSInt): ValReal; compilerproc; Function fpc_Val_UInt_WideStr (Const S : WideString; out Code : ValSInt): ValUInt; compilerproc; Function fpc_Val_SInt_WideStr (DestSize: SizeInt; Const S : WideString; out Code : ValSInt): ValSInt; compilerproc; +Function fpc_Val_Currency_WideStr(Const S : WideString; out Code : ValSInt): Currency; compilerproc; {$endif FPC_HAS_FEATURE_WIDESTRINGS} {$ifndef CPU64} Function fpc_val_int64_shortstr(Const S: ShortString; out Code: ValSInt): Int64; compilerproc; diff --git a/rtl/inc/sstrings.inc b/rtl/inc/sstrings.inc index 70bfc684ba..6fd56f9a62 100644 --- a/rtl/inc/sstrings.inc +++ b/rtl/inc/sstrings.inc @@ -627,6 +627,20 @@ begin end; +procedure fpc_chararray_Currency(c : Currency;len,fr : SizeInt;out a : array of char);compilerproc; +var + ss : shortstring; + maxlen : SizeInt; +begin + str(c:len:fr,ss); + if length(ss) 255 then + begin + fpc_Val_Currency_WideStr:=0; + code := 256; + end + else + begin + SS := S; + Val(SS,fpc_Val_Currency_WideStr,code); + end; +end; + + Function fpc_Val_UInt_WideStr (Const S : WideString; out Code : ValSInt): ValUInt; [public, alias:'FPC_VAL_UINT_WIDESTR']; compilerproc; Var SS : ShortString; @@ -1211,6 +1228,15 @@ begin end; +procedure fpc_WideStr_Currency(c : Currency;len,fr : SizeInt;out s : WideString);compilerproc; +var + ss : shortstring; +begin + str(c:len:fr,ss); + s:=ss; +end; + + Procedure fpc_WideStr_SInt(v : ValSint; Len : SizeInt; out S : WideString);compilerproc; Var SS : ShortString;