Word printable macros for decimal field

Hi Community,

 

I have a decimal field "UsrGrandTotal". I am showing this field in my word printable. How can I format the value of my field as  below:

 

Value: 2415.00

Must show as like this: 2,415.00

 

I found below link in academy but the problem is that, If the fractional part is zero, it will not be displayed. I need to show both the comma delimiter and the fractional 0 in 2 digits

https://academy.creatio.com/documents/technic-sdk/7-16/basic-macros-ms-…

Like 0

Like

3 comments

Dear Fulgen,

 

It’s possible to create a custom macros if there is no basic macros that would suit your business task. Please find the example of creating the custom macros in the article by the link below:

 

https://academy.creatio.com/documents/technic-sdk/7-16/how-create-macros-custom-report-word

 

Best regards,

Norton

I have an article with a sample here that is pretty close to what you're after, this custom macro will format money as $2,415.00 (based on the culture in the macro). You can see this article here https://customerfx.com/article/creating-custom-macros-to-format-values-in-word-printables-for-creatio-formerly-bpmonline/ You could use it as a starting point for yours and just replace the line

result = currency.ToString("C", new CultureInfo("en-US"));

to something like this

result = number.Format("{0:n}");

Ryan

Ryan Farley,

 Thanks Ryan, helps a lot!

Show all comments