Page 1 of 1

Double Parse fails with Input "0"

Posted: Tue Jul 31, 2018 8:51 am
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!

Re: Double Parse fails with Input "0"

Posted: Thu Aug 02, 2018 11:41 am
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))}

Re: Double Parse fails with Input "0"

Posted: Thu Aug 02, 2018 4:37 pm
by Lech Kulikowski
Hello,

Thank you for the information.