Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

nPrinting field format in Word

Hi,

I want to format a particular field in my MSWord template as a %. I am using the formatstring '#0.#%' to format the number. This works perfectly for all cases except where the percentage has no decimal places e.g 75%. The value appears in outputted report as 75.%. How can I get rid of the decimal point in these situations please?

Thanks in advance for your help

Eoin

1 Solution

Accepted Solutions
Not applicable
Author

I completely get it.

I don't think it's possible to have the decimal disappear even if all digits to the right are "0".

So either you can get 75.00% and 75.65%

or

75% and 76%

or

75.% and 75.65%

I do not think that 75% AND 75.65% is possible

View solution in original post

5 Replies
Not applicable
Author

Try 00.00%

This will yield 75.00%

I don't think there is a way to selectively show digits to the right of the decimal only when they are not 00, so either you can always round (75.7% = 76%) or always show decimals.

I'm not 100% certain about this however.

There is a tutorial which describes all the tags you can use in setting numerical, date and other formats here:

Which Formats Can I Use in Columns?

jonathandienst
Partner - Champion III
Partner - Champion III

The format string should be '0.0%', not '0.#%'. The '#' digit is only displayed if it is not 0.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks for the replies - I obviously did not explain myself properly ! It is the decimal point symbol that I want removed if the first value after the decimal point is a zero

examples:

When I use #0.#% I get the following sample results

decimal ; formatted % ;  result

0.123  ; 12.3% ; great

0.0123 ; 1.2% ; great

0.00123 ' 0.1% ; great

0.12  ; 12.% ; bad - decimal point (not place) is present

Aran - I don't want 75.00% - I just want 75% in this case

Jonathan - this would give me 75.0% - I just want 75% in this case

Thanks again

Not applicable
Author

I completely get it.

I don't think it's possible to have the decimal disappear even if all digits to the right are "0".

So either you can get 75.00% and 75.65%

or

75% and 76%

or

75.% and 75.65%

I do not think that 75% AND 75.65% is possible

Anonymous
Not applicable
Author

Thanks Aran and sorry for delay in responding. I got client to accept a single decimal even if it is zero