Download EPUB

(Medium) - How To Build A Money Data Type In JavaScript

Gist 1 min read Original article

This article is too short to generate a summary.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

multipliedBy: (dollarValue) => {
const multiplicationInCents = thisCents * dollarValue.cents;
const resultOfMultiplication = Number(
multiplicationInCents
.toString()
.slice(0, -2)
);
return Money(toDecimalPoint(resultOfMultiplication));
},

Keep this one

Free to use, with no card: save new links within daily limits and read everything you save.

Every new account gets the paid plan for its first 14 days.