format number in ssrs report

前端 未结 6 1934
太阳男子
太阳男子 2021-02-08 23:20

argh!

Can\'t stand it that i can\'t figure it out myself....

i\'ve used this in the formatting of a number in my report:

\'€\' #,0.00;(\'€\' #,0.         


        
6条回答
  •  隐瞒了意图╮
    2021-02-08 23:47

    You can find the definition of the comma and period dynamic behavior here: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx

    I think the best way to reliably get what you want is to hard code a locale into the expression for this field.

    = (new Decimal(11123.55)).ToString("€#,0.00;(€#,0.00)",
            new System.Globalization.CultureInfo("es-ES"))
    

    This will always use the comma as decimal, and period as millions, thousands &c.

    There are ways to be more dynamic and always return in the clients local set format, that would usually be preferable.

提交回复
热议问题