Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
question 1000s separator
XFabien
Hello,
I want to replace the 1000s separator comma to space, like this "20,000.01" >"20 000.01".
But there is not a local who use this format. I tried the script below :
this.getValue().toString().replaceAll(","," ");
but it didn't work.
If anyone who know how to change this?
I appriciate your help and thanks in advance.
Yao
Find more posts tagged with
Comments
mcremer
<blockquote class='ipsBlockquote' data-author="'XFabien'" data-cid="82009" data-time="1314613577" data-date="29 August 2011 - 03:26 AM"><p>
Hello,<br />
<br />
I want to replace the 1000s separator comma to space, like this "20,000.01" >"20 000.01".<br />
But there is not a local who use this format. I tried the script below : <br />
this.getValue().toString().replaceAll(","," ");<br />
but it didn't work. <br />
<br />
If anyone who know how to change this?<br />
<br />
I appriciate your help and thanks in advance.<br />
<br />
Yao<br /></p></blockquote>
<br />
Well you can script it in a sort. You need to first remember that when you will do this you have to make sure the object you showing your result in should be a <strong class='bbc'>STRING</strong> this is other wise the BIRT formating will take over.<br />
<br />
Then just set the formating rule for string to somting like this: **** **** **** **** ****,XX (you have to remeber that you need to ad the ,00 if there are no decimals)
thuston
Put this in the OnRender of your control and it will always format with a comma then replace with space.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var myFormatter = new java.text.DecimalFormat("#,###.00");
var fmtVal = myFormatter.format( this.getValue() );
this.setDisplayValue( fmtVal.replaceAll(","," ") );</pre>