Docs
OverviewTemplate SyntaxQuick Guide

Resources

Source code

Modifiers

Text
Casing
lowerslugtitletitle_modelupper
Edit
concathashreplacereplace_patternreverseshortenwrap
Split & join
joinlinessplit
Trim
trimtrim_prefixtrim_suffix
Escape
escape_htmlescape_jsescape_url
Format
currencydatedecimalfrom_datelengthline_numbers
Collections
Access
findfirstkeylastpluck
Query
filterhasis
Transform
cleanflattenmapmergesortsum
Files & paths
File
file
Path
dirnameextext_dotext_prependext_trimfilename
Convert
Parse
from_csvfrom_jsonfrom_yaml
Serialize
jsonmarkdownyaml
Logic
Compare
andeqgtgteltlteneqnotor
Default
defaultwhen
Render
Template
template
Datetime
add_daysadd_monthsadd_yearsdays_between
Math
adddividemultiplysubtract
Docs/Sintax/Math/add

add

Returns the value plus the given number, so `{{ subtotal | add:shipping }}` is the two of them together.

A negative argument subtracts, which makes subtract a convenience rather than the only way round.

InputArgumentsReturnsanyanyfloat64
Source
BasicSource

Adds a field to the value it is piped.

Given

{"subtotal": 42.5, "shipping": 4.95}

Template

{{ subtotal | add:shipping | decimal:2 }}

Result

47.45
Read the source of add on GitHub
PreviousMathNext divide

Built with in Vilnius, Lithuania Say hello!

ProductsOpen sourceDocs GitHub