npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-math-fns

v1.4.1

Published

This addon provides math helpers for Ember templates and components.

Downloads

7

Readme

ember-math-fns npm version Build Status codecov

This addon provides math helpers for Ember templates and components.

To install:

ember install ember-math-fns

Usage

math-abs

Determines the absolute value of a number. See Math.abs() for details on the Math.abs function.

{{math-abs -22}}
{{math-abs difference}}

math-add

Adds two or more numbers together.

{{math-add 1 2}}
{{math-add 1 2 3 5 8 13 21}}
{{math-add total tax}}

math-ceil

Rounds a number up to the nearest integer. See Math.ceil() for details on the Math.ceil function.

{{math-ceil 3.24}}
{{math-ceil giving}}

math-decrement

Decrement a value by 1.

{{math-decrement 10}}
{{math-decrement counter}}

math-divide

Divides two or more numbers from left to right.

{{math-divide 20 5}}
{{math-divide 100 10 5}}
{{math-divide paycheck wives}}

math-eq

Determines if two or more numbers are equal.

{{math-eq 20 5}}
{{math-eq 100 10 5}}
{{math-eq paycheck taxes}}

math-floor

Rounds a numbe down to the nearest integer. See Math.fllor() for details on the Math.fllor function.

{{math-floor 4.54}}
{{math-floor tax}}

math-gt

Determines if two or more numbers are greater than each other from left to right.

{{math-gt 20 5}}
{{math-gt 100 10 5}}
{{math-gt paycheck taxes}}

math-gte

Determines if two or more numbers are greater than or equal to each other from left to right.

{{math-gte 20 5}}
{{math-gte 10 10 5}}
{{math-gte paycheck taxes}}

math-increment

Increment a value by 1.

{{math-increment 0}}
{{math-increment counter}}

math-lt

Determines if two or more numbers are less than each other from left to right.

{{math-lt 5 20}}
{{math-lt 5 10 100}}
{{math-lt paycheck taxes}}

math-lte

Determines if two or more numbers are less than or equal to each other from left to right.

{{math-lte 5 20}}
{{math-lte 5 10 10}}
{{math-lte paycheck taxes}}

math-max

Determines the largest of two or more numbers. See Math.max() for details on the Math.max function.

{{math-max 17 22}}
{{math-max 4 3 29 4}}
{{math-max paycheck federalTaxes stateTaxes}}

math-min

Determines the smallest of two or more numbers. See Math.min() for details on the Math.min function.

{{math-min -22 8}}
{{math-min 14 23 11}}
{{math-min numberOfJiras timeInDay}}

math-mod

Perform the modulus of a value and its divisor to get the remainder.

{{math-mod 12 3}}
{{math-mod value divisor}}

math-multiply

Multiplies two or more numbers together.

{{math-multiply 4 5}}
{{math-multiply 11 10 2}}
{{math-multiply children costOfCollege}}

math-ne

Determines if two or more numbers are not equal.

{{math-ne 20 5}}
{{math-ne 100 10 5}}
{{math-ne tip tax}}

math-negate

Negate/invert the sign for a number.

{{math-negate 2}}
{{math-negate value}}

math-pow

Returns the result of a number to the power of the other. See Math.pow() for details on the Math.pow function.

{{math-pow 3 4}}
{{math-pow bugs numberOfCustomers}}

math-random

Returns a random decimal number between 0 and 1. See Math.random() for details on the Math.random function.

{{math-random}}

math-round

Round a number to the nearest integer. See Math.round() for details on the Math.round function.

{{math-round 14.5}}
{{math-round difference}}

math-sign

Return a -1 for a negative number and positive 1 for positive numbers. See Math.sign() for details on the Math.sign function.

{{math-sign -19}}
{{math-sign difference}}

math-subtract

Subtract two or more numbers from left to right.

{{math-subtract 3 2}}
{{math-subtract 100 10 9}}
{{math-subtract paycheck rent}}

Related Addons

Compatibility

  • Ember.js v3.4 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.