-
-
Notifications
You must be signed in to change notification settings - Fork 4
Smart Mode
The latest release of NoteMaster releases one of the most prominenent features, NML evaluates natural language text and automatically tries to resolve it to an result.
An example of NML:
100 + 10
// Output: 110
With in (into, as, to) you can convert one unit into another. NML will automatically convert units to perform operations if it's needed during conversion.
100cm in meters
10m - 100cm
Use time or now function to get time in your time zone. You can prefix this functions with time zone location (or use in with time zone suffix) to get current time for specified location. Results are always in sync with global time, so, at any point of time you will get the right time.
It's also possible to convert specific time or date from one time zone into another. Or calculate difference between time in different time zones:
PST time
New York time
Time in Madrid
2:30 pm HKT in Berlin
You can use sign and word operators. Several expressions might be stacked together.
8 times 9
100 + 100
100 + 10 / 2
| Operation | Sample |
|---|---|
| Addition | +, plus, add, and |
| Subtraction | -, minus, remove, subtract |
| Multiplication | *, times |
| Division | /, divide |
| Exponent | ^ |
| Left Shift | << |
| Right Shift | >> |
| Modulo | % - Coming Soon |
Besides decimal numeral system, it is possible to use numbers in binary, octal (coming soon) or hexadecimal form using appropriate prefix: 0b, 0o and 0x.
100
104.5
0x104
You can use ISO 4217 codes for currency (like USD, RUB, CAD etc). You can also use common currency names and signs, like $ for the US dollars, or € for Euro.
NML updates currency rates several times a day using exchange rates api service.
[Coming Soon] - NML also supports a huge list of cryptocurrencies with hourly rates updates.
In addition to general percentage operations like adding or subtracting percent of value ($10 - 40%), you also can use additional operations:
| Operation | Example |
|---|---|
| Percentage value | 20% of $10 |
| Adding percentage | 5% on $30 |
| Subtracting percentage | 6% off 40 EUR |
| Percentage value of one value relative to another | $50 as a % of $100 (Coming Soon) |
| Percentage addition of one value relative to another | $70 as a % on $20 (Coming Soon) |
| Percentage subtraction of one value relative to another | $20 as a % off $70 (Coming Soon) |
| Value by percent part | 5% of what is 6 EUR (Coming Soon) |
| Value by percent addition | 5% on what is 6 EUR (Coming Soon) |
| Value by percent subtraction | 5% off what is 6 EUR (Coming Soon) |
Scales used for shorter form of writing big numbers. Please note that one-letter scales are case-sensitive, since m used for meters, and K used for Kelvins. Supported scales: thousands (k, thousand), millions (M, million), billions (billion).
$2k
2M eur
You can declare variables and reuse them using the = operator. Please note some characters and keywords cannot be used as a variable. For example, K might be used as a temperature unit in Kelvin. Variable names should not contain whitespaces or special characters, and should not start with number:
$v = $20
$v2 = 5%
$v times 7 - $v2
You can declare labels by adding an : at the end of the text. This will be ignored and only execute the context to the right of the the : character. Labels do not store values unlike variables.
Result: 100 + 100
| Description | Value |
|---|---|
| Pi | 3.1415926536 |
| E | 2.7182818285 |
By default trigonometrical functions uses parameters in radians.
| Description | Function | Example |
|---|---|---|
| N-th root | root | root 2 (8) |
| Square root | sqrt | sqrt 16 |
| Cubed root | cbrt | cbrt 8 |
| Absolute value | abs | abs(-4) |
| Logarithm | log | log 2 (10) |
| Natural logarithm | ln | ln 3 |
| Factorial | fact | fact 5 |
| Rounding | round | round 3.45 |
| Ceiling | ceil | ceil 3.76 |
| Flooring | floor | floor 2.56 |
| Sine | sin | sin 45° |
| Cosine | cos | cos 3.45 |
| Tangent | tan | tan 8 |
| Arcsine | arcsin | arsin 30 |
| Arccosine | arccos | arccos 85 |
| Arctangent | arctan | arctan 9 |
| Hyperbolic sine | sinh | sinh 3 |
| Hyperbolic cosine | cosh | cosh 9 |
| Hyperbolic tangent | tanh | tanh 11 |
CSS - Coming Soon (https://github.com/andyjansson/css-unit-converter)
NML supports several CSS units: pixels (px), points (pt), em. Em is set to 16 px by default, but you can assign different value to it. Conversion from screen units to other length units performed using pixel per inch value (ppi). By default ppi is set to 96 pixels, which mean in every inch there're 96 pixels. You can set custom value for ppi.
12 pt in px
em = 20px
1.2 em in px
1 inch in px = 96 px
ppi = 326
1 cm in px = 128,35 px
Use prev token to use result from previous line:
Cost: $20 + 56 EUR
Discounted: prev - 5% discount
You can calculate sum of all lines above (until empty line) using sum ( total ) operator.
Result: sum $10 $15
You can calculate an average of all lines above (until empty line) using average ( avg ) operator.
Result: average
NML supports all the followings UoM's. Please note, that all UoM's prefixes are case sensitive.
- mm
- cm
- m
- in
- ft-us
- ft
- fathom
- mi
- nMi
- mm2
- cm2
- m2
- ha
- km2
- in2
- ft2
- ac
- mi2
- mcg
- mg
- g
- kg
- oz
- lb
- mt
- t
- mm3
- cm3
- ml
- l
- kl
- m3
- km3
- tsp
- Tbs
- in3
- fl-oz
- cup
- pnt
- qt
- gal
- ft3
- yd3
- mm3/s
- cm3/s
- ml/s
- cl/s
- dl/s
- l/s
- l/min
- l/h
- kl/s
- kl/min
- kl/h
- m3/s
- m3/min
- m3/h
- km3/s
- tsp/s
- Tbs/s
- in3/s
- in3/min
- in3/h
- fl-oz/s
- fl-oz/min
- fl-oz/h
- cup/s
- pnt/s
- pnt/min
- pnt/h
- qt/s
- gal/s
- gal/min
- gal/h
- ft3/s
- ft3/min
- ft3/h
- yd3/s
- yd3/min
- yd3/h'
- C
- F
- K
- R
- ns
- mu
- ms
- s
- min
- h
- d
- week
- month
- year
- Hz
- mHz
- kHz
- MHz
- GHz
- THz
- rpm
- deg/s
- rad/s
- m/s
- km/h
- m/h
- knot
- ft/s
- s/m
- min/km
- s/ft
- min/km
- Pa
- hPa
- kPa
- MPa
- bar
- torr
- psi
- ksi
- b
- Kb
- Mb
- Gb
- Tb
- B
- KB
- MB
- GB
- TB
- lx
- ft-cd
- ppm
- ppb
- ppt
- ppq
- V
- mV
- kV
- A
- mA
- kA
- W
- mW
- kW
- MW
- GW
- VA
- mVA
- kVA
- MVA
- GVA
- VAR
- mVAR
- kVAR
- MVAR
- GVAR
- Wh
- mWh
- kWh
- MWh
- GWh
- J
- kJ
- VARh
- mVARh
- kVARh
- MVARh
- GVARh
- deg
- rad
- grad
- arcmin
- arcsec
- c
- mC
- μC
- nC
- pC
- N
- kN
- lbf
- g (g-force)
- m/s2
To make time calculations more straightforward, 1 year is equal to 365 days, and 1 month equal to 1/12 of the year. In cases where results give non-integer value, round functions might be used to make an integer. Supported units: Second, minute, hour, day, week, month, year. Use fromunix function to convert timestamp into dates.
round(1 month in days)
fromunix(1446587186)
Supported units: kelvin, celsius, fahrenheit
Supported units: meter, mil, points, lines, inch, hand, foot, yard, rod, chain, furlong, mile, cable, nautical mile, league. Note, since in used as a conversion operator, you cannot use it for inches.
Supported units: hectare, are, acre and all "squared" length units.
20 cm2
30 in2
Supported units: Pint, quart, gallon, tea spoon, table spoon, cup.
20 cm3
30 in3
Supported units: gram, tonne, pound, stone, ounce.
Supported units: radians, degree. You can use both as text form of unit (radians, degrees) as sign. For example, 45 °.
Supports all digital units.
Use hash symbol at the beginning of the line to make a header. If you want to comment part of the line, use double quotes. To comment all line, use double slash.
# This is header
$275 for the "Model 227"
// This is comment
Price: $11 + $34.45
| Surround with parentheses | ⇧⌘0 |
| Copy result on current line | ⇧⌘C |
| Select all | ⌘A |
| Delete all | ⎇⌘⌫ |
| Copy all | ⎇⌘C |
| Import | ⌘O |
| Export | ⌘S |
| ⌘P |