CARVIEW |
Select Language
HTTP/2 301
date: Tue, 22 Jul 2025 19:00:36 GMT
content-type: text/html; charset=utf-8
content-length: 0
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
location: https://github.com/Handlebars-Net/Handlebars.Net.Helpers/wiki/Math
cache-control: no-cache
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
set-cookie: _gh_sess=QwLxkbwawrImCJ1V0FPHBBc32X%2B056udS2xDjcIf8VB%2FeNQ%2FiWpfCaIS1E4%2ByRLybDnZxbDEHxg5Fo37QdorCtAM8tdEva6IlSyVsLFtQtqRjiDNye1cGP5H8ThR4zkqVESr2YukeOv7BF8RuwbbKMqsatbIRtxadZjfHaEqtLRmNaKIXJkAqGajV5xSaSmF1eBvshOLk5mm1pgLARuW636rq%2BMNP7Y57dRJoKon1jVgr6z3wxAcgsoapIkDlZQnkaW3rLSV5zsnm2yF8pHeNQ%3D%3D--TSKQSw3Ik9ESklkl--493SUT%2BtDou%2FAJveGid3gw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1299098981.1753210836; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 19:00:36 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 19:00:36 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 9E26:167F3A:81C44:A0B6B:687FDFD4
HTTP/2 200
date: Tue, 22 Jul 2025 19:00:36 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"60212cba9708afa25d53fa04e1255282"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: 9E26:167F3A:81C6B:A0B9C:687FDFD4
Math · Handlebars-Net/Handlebars.Net.Helpers Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Math
Stef Heyenrath edited this page Apr 22, 2021
·
5 revisions
These helpers provide the ability to perform some calculations within a template.
- Math.Add / Math.Plus
- Math.Abs
- Math.Avg
- Math.Ceiling
- Math.Divide
- Math.Floor
- Math.Equal
- Math.GreaterThan
- Math.GreaterThanEqual
- Math.LessThan
- Math.LessThanEqual
- Math.NotEqual
- Math.Max
- Math.Min
- Math.Modulo
- Math.Multiply / Math.Times
- Math.Power
- Math.Round
- Math.Sign
- Math.Subtract / Math.Minus
- Math.Sqrt
Summary | Add two numbers |
Returns | Sum of inputs |
Remarks | |
Parameters | |
input1 | First input |
input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}
Usage
<strong>result:</strong>
{{Math.Add a b}}
{{Math.Add b c}}
{{Math.Add c 4}}
{{Math.Add 4 5}}
Returns
<strong>result:</strong>
3
5
7
9
Summary | Rounds input up to the nearest whole number |
Returns | Ceiling of input |
Remarks | |
Parameters | |
input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}
Usage
<strong>result:</strong>
{{Math.Ceiling a}}
{{Math.Ceiling b}}
{{Math.Ceiling c}}
{{Math.Ceiling 4.89}}
Returns
<strong>result:</strong>
2
3
4
5
Summary | Divide first input by second input |
Returns | Result of first input divided by second input |
Remarks | |
Parameters | |
input1 | First input |
input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}
Usage
<strong>result:</strong>
{{Math.Divide a b}}
{{Math.Divide b c}}
{{Math.Divide c 4}}
{{Math.Divide 4 5}}
Returns
<strong>result:</strong>
0.5
0.666666666666667
0.75
0.8
Summary | Rounds input down to the nearest whole number |
Returns | Floor of input |
Remarks | |
Parameters | |
input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}
Usage
<strong>result:</strong>
{{Math.Floor a}}
{{Math.Floor b}}
{{Math.Floor c}}
{{Math.Floor 4.89}}
Returns
<strong>result:</strong>
1
2
3
4
Summary | Modulus of first over second input |
Returns | Result of modulus of first input over second input |
Remarks | |
Parameters | |
input1 | First input |
input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}
Usage
<strong>result:</strong>
{{Math.Mod a b}}
{{Math.Mod b c}}
{{Math.Mod c 4}}
{{Math.Mod 4 5}}
Returns
<strong>result:</strong>
1
2
3
4
Summary | Multiply first input by second input |
Returns | Result of multiplication of first input and second input |
Remarks | |
Parameters | |
input1 | First input |
input2 | Second input |
Context
{
"a": 1,
"b": 2,
"c": 3
}
Usage
<strong>result:</strong>
{{Math.Multiply a b}}
{{Math.Multiply b c}}
{{Math.Multiply c 4}}
{{Math.Multiply 4 5}}
Returns
<strong>result:</strong>
2
6
12
20
Summary | Rounds input to the nearest whole number |
Returns | Rounded input |
Remarks | Rounds depending on what side of the half the number falls on |
Parameters | |
input | input |
Context
{
"a": 1.23,
"b": 2.45,
"c": 3.67
}
Usage
<strong>result:</strong>
{{Math.Round a}}
{{Math.Round b}}
{{Math.Round c}}
{{Math.Round 4.89}}
Returns
<strong>result:</strong>
1
2
4
5
Summary | Subtract second input from first |
Returns | Result of subtracting the second input from first |
Remarks | |
Parameters | |
input1 | First input |
input2 | Second input |
Context
{
"a": 4,
"b": 3,
"c": 1
}
Usage
<strong>result:</strong>
{{Math.Subtract a b}}
{{Math.Subtract b c}}
{{Math.Subtract c 2}}
{{Math.Subtract 2 5}}
Returns
<strong>result:</strong>
1
2
-1
-3
You can’t perform that action at this time.