From aa297445381b87f1b04956cf4b9c828ac25431c8 Mon Sep 17 00:00:00 2001 From: inoussa Date: Sat, 17 May 2014 14:58:42 +0000 Subject: [PATCH] Parser : map xsd:decimal to Currency. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3052 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/imp_utils.pas | 11 +++++++++-- wst/trunk/ws_helper/pascal_parser_intf.pas | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wst/trunk/imp_utils.pas b/wst/trunk/imp_utils.pas index 996c863eb..266a98f0a 100644 --- a/wst/trunk/imp_utils.pas +++ b/wst/trunk/imp_utils.pas @@ -143,13 +143,19 @@ function wst_FormatFloat( var s, frmt : string; prcsn : Integer; + decimal : Boolean; {$IFNDEF HAS_FORMAT_SETTINGS} i : PtrInt; {$ENDIF HAS_FORMAT_SETTINGS} begin + decimal := False; case GetTypeData(ATypeInfo)^.FloatType Of + ftCurr : + begin + decimal := True; + frmt := '##############0.####';//15.4 + end; ftSingle, - ftCurr, ftComp : prcsn := 7; ftDouble, ftExtended : @@ -163,7 +169,8 @@ begin else prcsn := 7; end; - frmt := '#.' + StringOfChar('#',prcsn) + 'E-0'; + if not decimal then + frmt := '#.' + StringOfChar('#',prcsn) + 'E-0'; {$IFDEF HAS_FORMAT_SETTINGS} s := FormatFloat(frmt,AData,wst_FormatSettings); {$ELSE} diff --git a/wst/trunk/ws_helper/pascal_parser_intf.pas b/wst/trunk/ws_helper/pascal_parser_intf.pas index 9ad7c1462..ee4dac6ef 100644 --- a/wst/trunk/ws_helper/pascal_parser_intf.pas +++ b/wst/trunk/ws_helper/pascal_parser_intf.pas @@ -277,7 +277,7 @@ const ('Qword', 'TComplexInt64UContentRemotable', 'unsignedLong'), ('Single', 'TComplexFloatSingleContentRemotable', 'float'), ('Double', 'TComplexFloatDoubleContentRemotable', 'double'), - ('Extended', 'TComplexFloatExtendedContentRemotable', 'decimal') + ('Extended', 'TComplexFloatExtendedContentRemotable', 'double') ); BOXED_TYPES_COUNT = 2; BOXED_TYPES : Array[0..Pred(BOXED_TYPES_COUNT)] Of array[0..2] of string = (