3.1.0 • Published 3 years ago
coc-calc v3.1.0
coc-calc
Features
- Support underscores in numbers
10_000_000 - Support bignumber, use decimal.js
- Support Mathematics functions

Usage
- Install by coc.nvim command:
:CocInstall coc-calc - Input calculate expression in any buffer
sin(PI / 2) =
Commands
calc.appendWithCursorCalculate and append in front of cursorcalc.appendCalculate and appendcalc.replaceWithCursorCalculate and replace in front of cursorcalc.replaceCalculate and replacecalc.calculatesee Vim API
Keymaps
Create keymappings like:
" append result on current expression
nmap <Leader>ca <Plug>(coc-calc-result-append)
" replace result on current expression
nmap <Leader>cr <Plug>(coc-calc-result-replace)Configurations
calc.priority, calc priority, default:1000calc.highlight, enable calc highlight, default:true
Vim API
calc.calculate
let result = CocAction('runCommand', 'calc.calculate', '1.5 * PI')Operators
Precedence is from highest to lowest.
| Operator | Example |
|---|---|
exponentiation ** | 4 ** 3 ** 2 equivalent to 4 ** (3 ** 2) |
unary + - | -2 +2 |
multiply / divide / remainder * / % | 4 % 3 4 * 3 |
| addition / subtraction | .2 - .1 .1 + .2 |
Mathematics Constant
EPI
Mathematics Functions
abs, acos, acosh, add, asin,
asinh, atan, atanh, atan2, cbrt
ceil, cos, cosh, div, exp,
floor, hypot, ln, log, log2,
log10, max, min, mod, mul,
pow, random, round, sign, sin,
sinh, sqrt, sub, tan, tanh, truncDetails: http://mikemcl.github.io/decimal.js/#methods
License
MIT
3.1.0
3 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.1.1
4 years ago
2.1.0
4 years ago
2.0.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.6.0
6 years ago
1.5.0
6 years ago
1.4.0
6 years ago
1.3.5
6 years ago
1.3.4
6 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.3.1
6 years ago
1.3.0
6 years ago
1.2.6
6 years ago
1.2.5
6 years ago
1.2.4
6 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago