Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional AMPscript functions #26

Merged
merged 3 commits into from
Jan 11, 2024
Merged

Conversation

lbuesching
Copy link
Collaborator

Adds the following functions:
URLENCODE - Modifies a string to only include characters that are safe to use in URLs.

BUILDROWSETFROMSTRING - Creates a rowset from a character string by splitting the string at the specified delimiter.

FORMATNUMBER - Formats a number as a numeric type, such as a decimal, date, or currency value.

There is a known issue with FORMATNUMBER for rounding digits.

Specifically:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

On .NET Framework and .NET Core up to .NET Core 2.0, the runtime selects the result with the greater least significant digit (that is, using MidpointRounding.AwayFromZero). On .NET Core 2.1 and later, the runtime selects the result with an even least significant digit (that is, using MidpointRounding.ToEven).

The in-production AMPscript implementation is on .net framework, this is .net 8.

Adds the following functions:
URLENCODE - Modifies a string to only include characters that are safe to use in URLs.

BUILDROWSETFROMSTRING - Creates a rowset from a character string by splitting the string at the specified delimiter.

FORMATNUMBER - Formats a number as a numeric type, such as a decimal, date, or currency value.

There is a known issue with FORMATNUMBER for rounding digits.

Specifically:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

On .NET Framework and .NET Core up to .NET Core 2.0, the runtime selects the result with the greater least significant digit (that is, using MidpointRounding.AwayFromZero).
On .NET Core 2.1 and later, the runtime selects the result with an even least significant digit (that is, using MidpointRounding.ToEven).

The in-production AMPscript implementation is on .net framework, this is .net 8.
@lbuesching lbuesching merged commit 7e7f7fb into main Jan 11, 2024
3 checks passed
@lbuesching lbuesching deleted the new_ampscript_functions branch January 11, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant