{"id":41283,"library":"ik-number-formatter","title":"ik-number-formatter","description":"Number formatter for components that converts large numbers into human-readable letter format (k, M, G, T). Current stable version: 0.0.7 (latest). No release cadence documented. Simple, lightweight, with no dependencies. Provides a single function `getNumberThousands` to format numbers with configurable decimals and decimal separator. Limited to European-style decimal commas and thousands separators. Not suitable for locale-aware formatting or scientific notation. Minimalism differentiates it from full-featured libraries like numeral.js or Intl.NumberFormat.","status":"active","version":"0.0.7","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","number","formatter"],"install":[{"cmd":"npm install ik-number-formatter","lang":"bash","label":"npm"},{"cmd":"yarn add ik-number-formatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add ik-number-formatter","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only. No ESM exports. Only default export object.","symbol":"default","correct":"const ikNumberFormatter = require('ik-number-formatter')"},{"note":"Function is attached to default export.","wrong":"getNumberThousands(value, decimals, separator) // must be called on imported object","symbol":"getNumberThousands","correct":"ikNumberFormatter.getNumberThousands(value, decimals, separator)"},{"note":"ESM import may work if environment supports CommonJS interop, but no ESM exports are declared in package.json. Named import will fail.","wrong":"import { getNumberThousands } from 'ik-number-formatter'","symbol":"default (ESM attempt)","correct":"import ikNumberFormatter from 'ik-number-formatter'"}],"quickstart":{"code":"const ikNumberFormatter = require('ik-number-formatter');\n\n// Format 5000 as 5K\nconsole.log(ikNumberFormatter.getNumberThousands(5000, 0, ',')); // '5K'\n\n// Format 1234567 as 1,23M with 2 decimals and comma separator\nconsole.log(ikNumberFormatter.getNumberThousands(1234567, 2, ',')); // '1,23M'\n\n// Format 5.67843 as 5,678 with 3 decimals\nconsole.log(ikNumberFormatter.getNumberThousands(5.67843, 3, ',')); // '5,678'\n\n// Note: decimal separator defaults to comma but must be passed explicitly in this version","lang":"javascript","description":"Demonstrates importing and using getNumberThousands with various formatting options."},"warnings":[{"fix":"Always pass a value for decimalSeparator, e.g., ',' or '.'.","message":"Function getNumberThousands requires decimal separator as third argument; there is no default.","severity":"gotcha","affected_versions":"0.0.7"},{"fix":"Always use dot as decimal separator in JavaScript numbers. The library's output uses the provided decimalSeparator.","message":"Input numbers with comma as decimal separator (e.g., 5,678) must be passed as string or with dot? Library accepts number type; dot is standard JS number.","severity":"gotcha","affected_versions":"0.0.7"},{"fix":"Use require() or ensure bundler handles CommonJS interop.","message":"Package has no ES module support; CommonJS only.","severity":"deprecated","affected_versions":"0.0.7"},{"fix":"Test with your expected range; may not handle edge cases.","message":"Only supports positive numbers? No documentation about negative numbers, zero, or very large numbers (>10^12).","severity":"gotcha","affected_versions":"0.0.7"}],"env_vars":null,"search_vec":"'0.0.7':26 'awar':66 'cadenc':30 'comma':57 'compon':8 'configur':46 'convert':10 'current':23 'decim':47,49,56 'depend':36 'differenti':72 'document':31 'european':54 'european-styl':53 'featur':77 'format':18,43,67 'formatt':4,6,85 'full':76 'full-featur':75 'function':40 'g':21 'getnumberthousand':41 'human':15 'human-read':14 'ik':2 'ik-number-formatt':1 'intl.numberformat':82 'javascript':83 'k':19 'larg':11 'latest':27 'letter':17 'librari':78 'lightweight':33 'like':79 'limit':51 'local':65 'locale-awar':64 'm':20 'minim':71 'notat':70 'number':3,5,12,44,84 'numeral.js':80 'provid':37 'readabl':16 'releas':29 'scientif':69 'separ':50,60 'simpl':32 'singl':39 'stabl':24 'style':55 'suitabl':62 'thousand':59 'version':25","created_at":"2026-06-04T18:51:39.232080+00:00","updated_at":"2026-06-04T18:51:39.232080+00:00","problems":[{"fix":"Use: const ikNumberFormatter = require('ik-number-formatter');","cause":"Incorrect import or destructuring.","error":"TypeError: ikNumberFormatter.getNumberThousands is not a function"},{"fix":"Run: npm install ik-number-formatter","cause":"Package not installed or wrong path.","error":"Error: Cannot find module 'ik-number-formatter'"},{"fix":"Pass decimals as second argument: getNumberThousands(5000, 2, ',') returns '5,00K'","cause":"Decimals parameter set to 0 or not passed.","error":"Unexpected output: e.g., 5000 returns '5K' but expected '5.00K'"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"ik-number-formatter","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"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}}