New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kopeiky.js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kopeiky.js

Lightweight library for counting some like cents(kopeiky) in javascript

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

kopeiky.js

If your're happy coding with js, proably see something like this:

> 0.20 + 0.01
< 0.21000000000000002

This library can help with that

Example

import kopeiky from "./index";

kopeiky(0.2).add(0.01).toNormal(); // 0.21
JSON.stringify({ money: kopeiky(0.2).add(0.01) }); // "{money: 0.21}"

Some trick:

> kopeiky(1) + 1
< 2

kopeiky API

Factory

kopeiky(number|kopeiky, {{ rank?: number }}): Kopeiky - default rank is 2

Instance Methods:

add(number|kopeiky): Kopeiky - add to current kopeiky
sub(number|kopeiky): Kopeiky subtract from current kopeiky
muliply(number): Kopeiky - muliply kopeiky
divide(number): Kopeiky - divide kopeiky
clone(): Kopeiky - return new instance of Kopeiky
valueOf(): number - return primitive number
toNormal(): number - return primitive number
toString(): string - return a number using fixed-point notation toString(): string - for normalize on json.stringify

FAQs

Package last updated on 26 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc