Code: Select all
var culture = new CultureInfo("de-DE");
var currencyFields = components.Where(x => x is StiText stiText && stiText.TextFormat is StiCurrencyFormatService).Select(x => x as StiText).ToList();
var format = new StiCurrencyFormatService(culture.NumberFormat.CurrencyPositivePattern, culture.NumberFormat.CurrencyNegativePattern, culture.NumberFormat.CurrencyDecimalSeparator, culture.NumberFormat.CurrencyDecimalDigits, culture.NumberFormat.CurrencyGroupSeparator, culture.NumberFormat.CurrencyGroupSizes[0], string.Empty, true, false, string.Empty);
currencyFields.ForEach(x => x.TextFormat = format);
Code: Select all
<AmountValue Ref="102" type="Text" isKey="true">
<AutoWidth>True</AutoWidth>
<Brush>Transparent</Brush>
<CanGrow>True</CanGrow>
<ClientRectangle>68,0,2.72,0.6</ClientRectangle>
<ComponentStyle>LabelValue</ComponentStyle>
<Conditions isList="true" count="0" />
<DockStyle>Left</DockStyle>
<Margins>0,0,0,0</Margins>
<MinSize>2.72,0</MinSize>
<Name>AmountValue</Name>
<Page isRef="9" />
<Parent isRef="76" />
<Text>{Items.Amount}</Text>
<TextBrush>Black</TextBrush>
<TextFormat Ref="103" type="CurrencyFormat" isKey="true">
<DecimalDigits>2</DecimalDigits>
<GroupSeparator>,</GroupSeparator>
<NegativePattern>1</NegativePattern>
</TextFormat>
<TextOptions>,,,,WordWrap=True,A=0</TextOptions>
<Type>DataColumn</Type>
</AmountValue>
Is this a bug? I would like to customise the number of decimal places, and not have the currency symbol at all, but still have all the other number formatting.
I have also tried doing the same but overriding NumberFormat, but this has the same issue.