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/subtract

subtract

Returns the value less the given number, the way a remaining quantity is worked out from a total and what has gone, as in `{{ seats | subtract:booked }}`.

It reads left to right like the sentence it stands for, which add with a negated argument cannot do when the amount is a field.

InputArgumentsReturnsanyanyfloat64
Source
BasicSource

Works out what is left of a total.

Given

{"seats": 120, "booked": 97}

Template

{{ seats | subtract:booked }} left

Result

23 left
Read the source of subtract on GitHub
Previousmultiply

Built with in Vilnius, Lithuania Say hello!

ProductsOpen sourceDocs GitHub