0.3.0 • Published 7 years ago
formule v0.3.0
Formule
JavaScript implementation of formulas for humans.
Contents
Installing
Using Yarn
yarn add formuleUsing NPM
npm install formuleUsing UMD
<script src="https://unpkg.com/formule/dist/formule.umd.js"></script>API
Constants
e
The base of the natural logarithm.
Types
number
Syntax
eExamples
e // 2.718281828459045pi
The ratio of a circle's circumference to its diameter.
Types
number
Syntax
piExamples
pi // 3.141592653589793Functions
concat
Concatenates its arguments and returns the result.
Types
Input: any
Output: string
Syntax
concat(...text)Examples
concat('Hello', 'World') // HelloWorldjoin
Inserts the first argument between the rest and returns their concatenation.
Types
Input: any
Output: string
Syntax
join(...text)Examples
join('-', 1, 2, 3) // 1-2-3now
Returns the current date and time.
Types
string
Syntax
now()Examples
now() // Nov 6, 1999toNumber
Parses a number from string, boolean or date.
Types
Input: string boolean number Date
Output: number
Syntax
toNumber(text)Examples
toNumber(false) // 0License
MIT
elaurent.org · GitHub emersonlaurentino · Twitter @elaurent_