Page 1 of 1

Useful VBS functions

PostPosted: Mon Jul 17, 2017 5:04 am
by JnCon
I just want to share two useful NB functions in VBS you can use the in any publication.

1. Weekday from date (returns with the name of days from date):

{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%1]|Number|Date:
Param=[%2]|Variable|Day of the week:
{End}
publication.nbSetVar "[%2]", Weekday("[%1]",0)

2. Formatting numbers

In some cases you need to display the numbers in decimal groups. For example 1 234 567 USD looks better than 1234567 USD. This simple script can do this:

{NeoBook Function}
Version=5,80
Language=VBScript
Param=[%1]|Number|Number to be formatted:
Param=[%2]|Variable|Variable to store result:
{End}
publication.nbSetVar "[%2]", FormatNumber([%1], NoDecimals)

Re: Useful VBS functions

PostPosted: Fri Jul 28, 2017 5:44 pm
by Neosoft Support
Awesome! Thank you for sharing these with us.