Double Parse fails with Input "0"

Stimulsoft Reports.WPF discussion
Post Reply
DaveKnight
Posts: 2
Joined: Tue May 08, 2018 12:17 pm

Double Parse fails with Input "0"

Post by DaveKnight »

Hello!

I have the following Input for my TextField:
{Format("{0:#}", double.Parse(reportData.ct_nr_cyc_lc_cstm_res.Value))}

If my Value is for example "635" everything works fine, but if my Value is "0" only a whitespace is represented.

What could be the problem here?

Thanks for your help!
maxlock
Posts: 5
Joined: Tue Jul 17, 2018 12:34 pm

Re: Double Parse fails with Input "0"

Post by maxlock »

Hi,
thats not a Stimulsoft problem.
If I have the code

Code: Select all

string.Format("{0:#}", 0)
then the result is also an empty string. It's the format with the #. If you have the following code, you will get what you expected:

Code: Select all

string.Format("{0:0}", 0)
or simple

Code: Select all

string.Format("{0}", 0)
So with your code it will be:

Code: Select all

{Format("{0}", double.Parse(reportData.ct_nr_cyc_lc_cstm_res.Value))}
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Double Parse fails with Input "0"

Post by Lech Kulikowski »

Hello,

Thank you for the information.
Post Reply