Jump to content
Software FX Community

CustomFormat


User (Legacy)

Recommended Posts

Dear Joe,

OK great question.

The solution is like this:

CustomFormat = "###.00'%'"; // Notice the single quotes around the % sign.

This is true because ...

See here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp

"The presence of a '%' character in a format string causes a number to be

multiplied by 100 before it is formatted."

What we do is just like this:

double d = 140;

string s = d.ToString("###.00'%'");

So without the single quotes s would be 14000.00%

and with 140.00%

The link above together with the d.ToString() test code you should always be

able to get what you want.

-c

"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message

news:TxMunm3wFHA.3776@webserver3.softwarefx.com...

> If I use a CustomFormat = ###.00% for my AxisY on a Line chart, the chart

> seems to multiple the value by 100. For example I assign a value of 26.21

> and it gets displayed as 2620.93.

>

> Is there a way to prevent this?

>

Link to comment
Share on other sites

  • 3 weeks later...

Thanks! That makes perfect sense.

Sorry for the long delay. I actual came up with a work around but like your

idea much better.

-Joe

"Software FX Support" <support@softwarefx.com> wrote in message

news:9gMpeLdxFHA.1764@webserver3.softwarefx.com...

> Dear Joe,

> OK great question.

> The solution is like this:

> CustomFormat = "###.00'%'"; // Notice the single quotes around the %

> sign.

> This is true because ...

> See here:

> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp

> "The presence of a '%' character in a format string causes a number to be

> multiplied by 100 before it is formatted."

>

> What we do is just like this:

> double d = 140;

> string s = d.ToString("###.00'%'");

>

> So without the single quotes s would be 14000.00%

> and with 140.00%

>

> The link above together with the d.ToString() test code you should always

> be able to get what you want.

> -c

>

> "Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message

> news:TxMunm3wFHA.3776@webserver3.softwarefx.com...

>> If I use a CustomFormat = ###.00% for my AxisY on a Line chart, the chart

>> seems to multiple the value by 100. For example I assign a value of 26.21

>> and it gets displayed as 2620.93.

>>

>> Is there a way to prevent this?

>>

>

>

Link to comment
Share on other sites

  • 3 weeks later...

So wait, you came up with a workaround and didn't share it!!!!

That's not fair, just joking.

Good Luck!!!

-c

"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message

news:mJfeUdN1FHA.1724@webserver3.softwarefx.com...

> Thanks! That makes perfect sense.

>

> Sorry for the long delay. I actual came up with a work around but like

> your idea much better.

> -Joe

>

> "Software FX Support" <support@softwarefx.com> wrote in message

> news:9gMpeLdxFHA.1764@webserver3.softwarefx.com...

>> Dear Joe,

>> OK great question.

>> The solution is like this:

>> CustomFormat = "###.00'%'"; // Notice the single quotes around the %

>> sign.

>> This is true because ...

>> See here:

>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcustomnumericformatstrings.asp

>> "The presence of a '%' character in a format string causes a number to be

>> multiplied by 100 before it is formatted."

>>

>> What we do is just like this:

>> double d = 140;

>> string s = d.ToString("###.00'%'");

>>

>> So without the single quotes s would be 14000.00%

>> and with 140.00%

>>

>> The link above together with the d.ToString() test code you should always

>> be able to get what you want.

>> -c

>>

>> "Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message

>> news:TxMunm3wFHA.3776@webserver3.softwarefx.com...

>>> If I use a CustomFormat = ###.00% for my AxisY on a Line chart, the

>>> chart seems to multiple the value by 100. For example I assign a value

>>> of 26.21 and it gets displayed as 2620.93.

>>>

>>> Is there a way to prevent this?

>>>

>>

>>

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...