Skip to content

Instantly share code, notes, and snippets.

@wvpv
Last active September 30, 2025 22:01
Show Gist options
  • Save wvpv/0db9f20af37945e9dee84e647b148139 to your computer and use it in GitHub Desktop.
Save wvpv/0db9f20af37945e9dee84e647b148139 to your computer and use it in GitHub Desktop.
SFMC-AMPscript-Truncate-Decimal
%%[
set @num1 = 12.99
set @num1_rounded = Format(@num1, "N0")
set @num1_formatted = @num1_rounded
if @num1_rounded > @num1 then
set @num1_formatted = subtract(@num1_rounded, 1)
endif
]%%
num1: %%=v(@num1)=%%
<br>num1_rounded: %%=v(@num1_rounded)=%%
<br>num1_formatted: %%=v(@num1_formatted)=%%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment