How Can I Format Numbers to Have a Thousand Separator on DIAdem Report?

Updated Jul 10, 2018

Reported In

Software

  • DIAdem

Issue Details

  • I've seen some Reports in DIAdem with numbers greater or equal to one thousand and they do not have a thousand separator symbol (either dot or comma). How can I include it to my numeric values on DIAdem Report?

Solution

You can use the FormatNumber method in a DIAdem Script to insert the separators. The parameter responsible for that is [GroupDigits]. This parameter specifies whether the FormatNumber method groups numbers and valid values are vbTrue, vbFalse, and vbUseDefault.

By default, if you do not define a value for [GroupDigits] it will group the numbers by default. So, if you run the following script:
Dim MyNumber 
MyNumber = -12345.6789
Call MsgBox(FormatNumber (MyNumber))
You will get the number on the message box as shown below.



However, if you set [GroupDigits]to vbFalse, it would not group numbers. So, if you run the following script:

Dim MyNumber
MyNumber = -12345.6789

Call MsgBox(FormatNumber (MyNumber, , , , vbFalse))

You will get the following dialog Box:



Altough the examples above shows the number in a Messa Box, you can use them as a guide to format text fields on your report.

Additional Information

  • The FormatNumber considers the same standard as the Operating System Number format. That means, if your system considers a comma as a thousand separator, the Function will use the same separator.

WAS THIS ARTICLE HELPFUL?

Not Helpful