Source language: Translate to:

Useful VBS functions

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Useful VBS functions

Postby JnCon » Mon Jul 17, 2017 5:04 am

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)
JnCon
 
Posts: 2
Joined: Tue Sep 20, 2016 8:38 am

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest

cron