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

fp-money

Package Overview
Dependencies
Maintainers
3
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fp-money - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

dist/currencies.d.ts

4

package.json
{
"name": "fp-money",
"version": "1.0.0",
"version": "1.1.0",
"private": false,

@@ -44,3 +44,3 @@ "description": "FluidPay input formatter and currency selector",

"vue": "^3.2.39",
"vue-loader": "^17.0.0",
"vue-loader": "^17.1.1",
"vue-router": "^4.1.5",

@@ -47,0 +47,0 @@ "vue-template-compiler": "^2.7.10",

@@ -132,2 +132,3 @@ export interface Currencies {

// bankersRounding handles rounding a number using bankers rounding.
export function bankersRounding(num: number, fraction: number): number {

@@ -144,1 +145,30 @@ const d = fraction || 0

}
// originalNumberFromPercentage takes in a number and a percentage and
// calculates what the original number was multiplied by the percentage to get
// the passed in number.
export function originalNumberFromPercentage(number: number, percentage: number, fraction: number): number {
// Get a clean number from either string or number
const numberStr = number.toString()
if (numberStr.trim() === '') {
return 0
}
number = parseFloat(numberStr)
// Get a clean percentage from either string or number
const percentageStr = percentage.toString()
if (percentageStr.trim() === '') {
return 0
}
percentage = parseFloat(percentageStr)
// Get fraction multiplier
let multi = '1'
for (let i = 0; i < fraction; i++) {
multi += '0'
}
const multiInt = parseInt(multi, 10)
const percentageValue = 1 + percentage / 100
return Math.round(Number((number / percentageValue).toFixed(5)) * multiInt) / multiInt
}
const path = require('path')
const MiniCssExtractPlugin = require("mini-css-extract-plugin")
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const { VueLoaderPlugin } = require('vue-loader')

@@ -5,0 +5,0 @@ module.exports = {

Sorry, the diff of this file is not supported yet

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