Dear Sir,
I am Facing Problem with The number Format. Instaed of Thosand Separator I want Million Separator..
For Eg: in Crsyal Report The Number will Display Like this 5,633,000.00. Instaed of This format I want this Number to be display Like 56,33,000.00. How i can Do that,,
Thanks in Advance
AmbilyUse Formula field having this code
stringvar Amount:="453453455.00";
stringvar s:=mid(Amount,1,len(Amount)-3);
select len(s)
case 3 : s & ".00"
case 4 : left(s,1) & "," & right(s,3)& ".00"
case 5 : left(s,2) & "," & right(s,3)& ".00"
case 6 : left(s,1) & "," & mid(s,2,2) & "," & right(s,3)& ".00"
case 7 : left(s,2) & "," & mid(s,2,2) & "," & right(s,3)& ".00"
case 8 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & right(s,3)& ".00"
case 9 : left(s,2) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & right(s,3)& ".00"
case 10 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & mid(s,6,2) & "," & right(s,3)& ".00"
default : s & ".00"
Madhivanan|||may i ask how to modify your script to get thousands separator?. i have case statement in my formula for differernt format. Don't want the .xx if they are both zeros.|||Hi 9e9+
Can you post the number and exepeted formated number?
Madhivanan|||Hi Madhi,
Thank you For your Fast Reply...
But i am Not Able to get the format..even though i analysed the function...but it is displaying The same format ,which crytsal report is giving.
Can u plz suggest any Other Function..|||Can you post the code you used?
Madhivanan|||Function (Currencyvar v1)
stringvar s:=mid(Totext(V1),2,len(Totext(V1))-4);
//stringvar str[100]=split(s,",");
//stringVar array str:=split(s,",");
//stringvar s=join(s2,",")
stringvar X:=mid(Totext(V1),Len(Totext(V1))-2,Len(Totext(V1)));
select len(S)
case 3 : s & X
case 4 : left(s,1) & "," & right(s,3)& X
case 5 : left(s,2) & "," & right(s,3)& X
case 6 : left(s,1) & "," & mid(s,2,2) & "," & right(s,3)&X
case 7 : left(s,2) & "," & mid(s,3,2) & "," & right(s,3)& X
case 8 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & right(s,3)& X
case 9 : left(s,2) & "," & mid(s,3,2) & "," & mid(s,5,2) & "," & right(s,3)& X
case 10 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & mid(s,6,2) & "," & right(s,3)& X
default : s & ".00" ;
This is the code i used. I rewrote the code bcecoz, By default The crystal report is taking $ symbol also with the Number format.
Now i am struggling becoz it will take the Thousand Seperator (,) also. So while taking leng\th , it will count The & symbol and Thousand seperator.
I dont want those...
So i am trying to Split the Number into array (,) and Join again with out Commas.
Can you help me.
I cant change the Reprt options again..coz already 150+ reports addaed..Now for all reports i hav to Update this Format..
or pls suggest me, any short cut method is available ...
Thanks
Ambily|||Hi Mr Madhi,
Thanks a Lot for ur Support.. The problem was Simple...But It troubled a Lot
I wrote A functon with ur code
Function (Currencyvar v1)
Numbervar A:=(Tonumber(V1));
stringvar s:=Totext(A);
stringvar X:=mid(Totext(V1),Len(Totext(V1))-2,Len(Totext(V1)));
select len(s)
case 3 : s & X
case 4 : left(s,1) & "," & right(s,3)& X
case 5 : left(s,2) & "," & right(s,3)& X
case 6 : left(s,1) & "," & mid(s,2,2) & "," & right(s,3)&X
case 7 : left(s,2) & "," & mid(s,3,2) & "," & right(s,3)& X
case 8 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & right(s,3)& X
case 9 : left(s,2) & "," & mid(s,3,2) & "," & mid(s,4,2) & "," & right(s,3)& X
case 10 : left(s,1) & "," & mid(s,2,2) & "," & mid(s,4,2) & "," & mid(s,6,2) & "," & right(s,3)& X
default : s & ".00" ;
Now i am getting The currency format , which i need
Once again Thanks!!!
Ambily
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment