custom mask ignored

Stimulsoft Reports.NET discussion
Post Reply
grazi
Posts: 39
Joined: Fri May 23, 2008 1:55 am

custom mask ignored

Post by grazi »

Hi there,

I wanted to change the appearance of a number in the report from e.g. 123456789012345678901234567 to 12 34567 89012 34567 89012 34567 by using the custom mask, but whatever I try, it doesn't change at all. So far i tried the 00 00000 00000 00000 00000 00000 and ## ##### ##### ##### ##### ##### masks.

The same problem i get when wanting to change a number like 1234.56 to 1234 56

Thanks for your help
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

custom mask ignored

Post by Edward »

Hello, Graziano.

Here is a wonderful article about formatting:

http://blog.stevex.net/index.php/string ... in-csharp/

Please make sure that you are formatting number and not the string:

Code: Select all

{12345.6d}
 or
 (decimal.Parse(MyDataSource.MaStringDataColumn))
Then you can do a trick:

set the required format for number, but with necessary symbols as , or . for decimal point and group separators and then just apply that format in Text expression and add Replace() method for substitution of ',' symbols to spaces, i.e.:

Code: Select all

 {Text1.TextFormat.Format(12345.6d).Replace(","," ").Replace("."," ")}
Thank you.
Post Reply