Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gl-w-frontend

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gl-w-frontend - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

2

lib/scripts/core/services/string/core-services-string.service.d.ts

@@ -17,3 +17,3 @@ import { TCurrencyNames, TCurrencySymbolTypes, TDecimalSeparators } from './core-services-string-interface';

currencyNameToSymbol(currency: TCurrencyNames): string;
decimalNumberToString(num: number, decimalOutput?: TDecimalSeparators): string;
decimalNumberToString(num: number, decimalOutput?: TDecimalSeparators, places?: number): string;
formatNumber(num: number, decimal?: TDecimalSeparators): string;

@@ -20,0 +20,0 @@ numberToString(number: number): string;

@@ -0,1 +1,2 @@

import Decimal from 'decimal.js';
import { UrlDecode } from '../url/core-services-url.service';

@@ -110,7 +111,9 @@ class Clean {

}
decimalNumberToString(num, decimalOutput = '.') {
const value = Math.round((num + Number.EPSILON) * 100.0) / 100.0;
return value
.toString()
.replace('.', decimalOutput);
decimalNumberToString(num, decimalOutput = '.', places = 2) {
const value = new Decimal(num);
const stringValue = value.toDecimalPlaces(places).toFixed(places);
const separator = decimalOutput === ',' ? '$1.' : '$1,';
return stringValue
.replace('.', decimalOutput)
.replace(/(\d)(?=(\d{3})+(?!\d))/g, separator);
}

@@ -117,0 +120,0 @@ formatNumber(num, decimal = '.') {

{
"name": "gl-w-frontend",
"version": "3.0.0",
"version": "3.0.1",
"description": "Common code for using among web front-end development such as ES6+ and TypeScript",

@@ -5,0 +5,0 @@ "main": "lib/bundle.js",

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