0.3.0 • Published 6 years ago

formule v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

Formule

JavaScript implementation of formulas for humans.

Contents

Installing

Using Yarn

yarn add formule

Using NPM

npm install formule

Using UMD

<script src="https://unpkg.com/formule/dist/formule.umd.js"></script>

API

Constants

e

The base of the natural logarithm.

Types

number

Syntax

e

Examples

e // 2.718281828459045

pi

The ratio of a circle's circumference to its diameter.

Types

number

Syntax

pi

Examples

pi // 3.141592653589793

Functions

concat

Concatenates its arguments and returns the result.

Types

Input: any Output: string

Syntax

concat(...text)

Examples

concat('Hello', 'World') // HelloWorld

join

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-3

now

Returns the current date and time.

Types

string

Syntax

now()

Examples

now() // Nov 6, 1999

toNumber

Parses a number from string, boolean or date.

Types

Input: string boolean number Date Output: number

Syntax

toNumber(text)

Examples

toNumber(false) // 0

License

MIT


elaurent.org  ·  GitHub emersonlaurentino  ·  Twitter @elaurent_