Monday, February 20, 2012

Percentage Format

I am trying to display a figure as a Percentage.

The figure is 2.00000. I want it to show as 2.00%.

When i go into the formatting i select P but it displays the figure as 200.00%.

What formatting code should i use to get 2.00%?

The format code 'P' multiplies your value by 100 then adds the % symbol at the end. You can do a couple things to get this fixed. Remove where you are multiplying the value by 100 in code, then set the format code to 'P'.

Another way is to use this as your expression for your field.

=Format(Fields!Field1.Value, "0.00") & "%"

Hope this helps.

Jarret

|||

Using

=Format(Fields!Field1.Value, "0.00") & "%"

That works for fields where value is 0.00000 and retunrs it as 0.00%. which is great. But the firld with 2.00000 is coming back as 2200.00%?

i am not multiplying anything by 100 in code so how can i remove it. Maybe i'm not understanding. Where do i remove the multiply by 100?

|||

What formula are you using to get the 2.00000? I am wondering how you got a value greater than 1.

If you use =Format(Fields!Field1.Value, "0.00") & "%" as the expression for your textbox, you will need to remove the format code 'P' from the textbox.

Jarret

|||

I was putting it in where teh Format Expression was not the Textbox value.

thanks

|||

Try this

Past this at Value filed instead of Format

=Format(Fields!OWNERSHIP_PERCENTAGE.Value,"P")

It should work. otherwise let me know

|||

Vijay,

It seems that Duncan's values were already in decimal form and just needed to have 2 decimals and a % afterwards. Using the format code 'P' multiplies the value by 100, gets 2 decimals, and adds the % sign. The fact that it multiplies it by 100 is what was throwing off Duncan's values, and why we couldn't use the 'P' format code.

Jarret

No comments:

Post a Comment