Josef
Josef

Reputation: 2726

Specific format number in RDLC

I'm trying to format expression which as result holds numerical value. This value should be format/displayed like for example 12.456,78 I've tryed to set custom format #.###,## number is still displyed like 12,456.78

Is there any way to set format just as I want?

Upvotes: 1

Views: 2841

Answers (2)

Josef
Josef

Reputation: 2726

I think I found solution.

  • first select object with expression, usually text box and in properties find property Format and enter this: #,0.00;(#,0.00)
  • somewhere below format find Language property and set to hr-HR (this is for Croatia Republic). That's all...

Upvotes: 1

Ross Bush
Ross Bush

Reputation: 15175

Are you wanting to force a specific culture's number formats? The String.Format() function will use the current culture for thousands separator and decimal point?

You can override items of the NumberFormatInfo, however you will have to embed this as custom code in your report. As in

<expression>=Code.OverrideNumberFormat(Fields!MyNumber.Value)

Public String OverrideNumberFormat(Float number) As String
Begin
....
End Function

See this article with an example of overriding a cultures NumberFormatInfo.

Upvotes: 2

Related Questions