问题描述
啊!
无法忍受,我自己无法弄清楚....
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.00)
格式为 1,212.89 欧元
and that formats to € 1,212.89
这不是我想要的,因为我想要 1.212,89 欧元无论服务器的区域设置如何.
which is not exactly what i want, because i want € 1.212,89regardless of the regional setting of the server.
所以我试过了
'€' #.0,00;('€' #.0,00)
但这给了我这个:1.212.890
but that gives me this:1.212.890
打字时我意识到我不知道 # 和 .和 , 表示格式字符串.....
Typing this i realize that i don't know what the # and the . and the , mean in the format string.....
推荐答案
您可以在此处找到逗号和句点动态行为的定义:http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
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"))
这将始终使用逗号作为小数,句点作为百万、千 &c.
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.
这篇关于ssrs 报告中的格式编号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!