Get Drawloop to render 4 decimal places on a field in Word Template.

  • 22 August 2016
  • 7 replies
  • 23 views

Using a Word template with Drawloop, and displaying a field (from a Salesforce object) that has 4 decimal places. Only 2 of the 4 decimal places are being rendered.  How do I need to treat the field to render all 4 decimal places?


7 replies

Hey John,

I don't know if I can help here, but I'm curious as to the setup your have. I use formatting in Word to limit the number of decimals that are displayed, but all the decimals in the field have always been included.

Do you have the tag in a mergefield of some sort already?

In the Word template, I have a table defined as follows, with Drawloop tags specified as <<field>>:




State

WC Code

WC Rate

WC Description


<<Workers_Comp_Calcs_Start>> <<Workers_Comp_Calcs_State_Code>>

<<Workers_Comp_Calcs_WC_Code>>

<<Workers_Comp_Calcs_WC_Rate>>

<<Workers_Comp_Calcs_Description>>



The field called <<Workers_Comp_Calcs_WC_Rate>> (WC Rate) in the 3rd cell is defined with 4 decimal places. Drawloop renders the value with only 2 decimal places. I need to understand where to control the number of decimal places rendered.

Thanks,

John

I believe that the number of decimals is governed by the Salesforce field, is the <<Workers_Comp_Calcs_WC_Rate>> set to hold 4 decimals?

(You can definitely force word to add additional decimal spaces by formatting the field to 4, but if in Salesforce the field only has 2 decimals it will just add 0's to the end.)

Yes, as I said the field is defined with 4 decimal places in Salesforce.

This rendering problem “resolved itself” yesterday when I re-published the template document. (Yeah, that was interesting!) So consider the issue closed.

Thanks you!

You did, sorry about that...

Glad its working now!

Hey Yisroel,

Can you please send me the format to force adding the decimal in the mail merge for the currencies field.

Hey Yuvraj Ganesan‌,

You add a MS Word mergefield and use standard Word formatting.
So you'd use Shift+F9 to add the mergefield, and then add the word MERGEFIELD before your Salesforce tag and then # with a format after the tag.

Here are two examples of how 1234.567 in salesforce will show using different merge formatting:

{ MERGEFIELD <<Your_Field_Here>> # 0.00000 }  will show as 1234.56700

{ MERGEFIELD <<Your_Field_Here>> # $,0.00 } will show as $1,234.57

(there are many many options for different requirements you may have, just search for MS word picture switches)

Reply