{"id":41964,"library":"simple-currency-formatter","title":"Simple Currency Formatter","description":"A minimal currency formatting utility extracted from vue2-filters, providing basic locale-aware currency formatting without relying on Intl.NumberFormat. Version 1.0.4 is the latest stable release; no active development or release cadence is evident. It supports simple symbol and decimal formatting with configurable currency symbol and decimal separator. Suitable for lightweight projects where Intl is unavailable or undesired, but lacks modern features like fractional digits control and extended locale support.","status":"maintenance","version":"1.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/kovsky0/simple-currency-formatter","tags":["javascript","currency","formatter","typescript"],"install":[{"cmd":"npm install simple-currency-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add simple-currency-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add simple-currency-formatter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; package does not export a CommonJS module.","wrong":"const currencyFormatter = require('simple-currency-formatter')","symbol":"currencyFormatter","correct":"import { currencyFormatter } from 'simple-currency-formatter'"},{"note":"formatCurrency is a named export, not default.","wrong":"import { default as formatCurrency } from 'simple-currency-formatter'","symbol":"formatCurrency","correct":"import { formatCurrency } from 'simple-currency-formatter'"},{"note":"Default import is available but not recommended; named exports are preferred.","wrong":"import { default } from 'simple-currency-formatter'","symbol":"default","correct":"import currencyFormatter from 'simple-currency-formatter'"}],"quickstart":{"code":"import { formatCurrency } from 'simple-currency-formatter';\n\nconst result = formatCurrency(1234.56, {\n  symbol: '$',\n  decimal: '.',\n  precision: 2,\n  separator: ','\n});\nconsole.log(result); // \"$1,234.56\"","lang":"typescript","description":"Shows basic usage of formatCurrency with options for symbol, decimal separator, precision, and thousands separator."},"warnings":[{"fix":"Prepend '-' manually or use a more robust library.","message":"The package does not handle negative numbers; negative values are formatted without a minus sign.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use Math.round before passing the value.","message":"Precision option does not round correctly for floating-point numbers; it truncates decimal places.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider alternatives like accounting-js or Intl.NumberFormat.","message":"The package is not actively maintained; last update in 2019 (v1.0.4).","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.0.4':26 'activ':33 'awar':18 'basic':15 'cadenc':37 'configur':48 'control':71 'currenc':2,6,19,49,77 'decim':45,52 'develop':34 'digit':70 'evid':39 'extend':73 'extract':9 'featur':67 'filter':13 'format':7,20,46 'formatt':3,78 'fraction':69 'intl':59 'intl.numberformat':24 'javascript':76 'lack':65 'latest':29 'lightweight':56 'like':68 'local':17,74 'locale-awar':16 'minim':5 'modern':66 'project':57 'provid':14 'releas':31,36 'reli':22 'separ':53 'simpl':1,42 'stabl':30 'suitabl':54 'support':41,75 'symbol':43,50 'typescript':79 'unavail':61 'undesir':63 'util':8 'version':25 'vue2':12 'vue2-filters':11 'without':21","created_at":"2026-06-04T18:54:57.720039+00:00","updated_at":"2026-06-04T18:54:57.720039+00:00","problems":[{"fix":"Use import { currencyFormatter } from 'simple-currency-formatter' and call it accordingly.","cause":"Using default import incorrectly; the library exports named exports, not a default function.","error":"TypeError: currencyFormatter is not a function"},{"fix":"Ensure the amount is a valid number: formatCurrency(Number(amount) || 0, options)","cause":"Passing undefined or null as the amount.","error":"Cannot read property 'replace' of undefined"},{"fix":"Switch to ES modules: import { formatCurrency } from 'simple-currency-formatter'.","cause":"Attempting to use CommonJS require in an ESM-only environment.","error":"formatCurrency is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/kovsky0/currency-formatter#readme","github":"https://github.com/kovsky0/simple-currency-formatter","docs":null,"changelog":null,"pypi":null,"npm":"simple-currency-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["payments"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}