Page 1 of 1

custom mask ignored

Posted: Thu Sep 11, 2008 3:00 am
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

custom mask ignored

Posted: Fri Sep 12, 2008 5:07 am
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.