{"id":21404765,"url":"https://github.com/fakundo/excel-style-javascript-dataformatter","last_synced_at":"2025-10-25T05:04:05.750Z","repository":{"id":11190431,"uuid":"13570507","full_name":"fakundo/Excel-Style-Javascript-DataFormatter","owner":"fakundo","description":"Excel-Style Dataformatter","archived":false,"fork":false,"pushed_at":"2017-12-25T12:30:35.000Z","size":395,"stargazers_count":8,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-22T04:12:39.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fakundo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-14T19:10:59.000Z","updated_at":"2017-09-30T00:41:14.000Z","dependencies_parsed_at":"2022-08-31T07:10:45.123Z","dependency_job_id":null,"html_url":"https://github.com/fakundo/Excel-Style-Javascript-DataFormatter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fakundo/Excel-Style-Javascript-DataFormatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2FExcel-Style-Javascript-DataFormatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2FExcel-Style-Javascript-DataFormatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2FExcel-Style-Javascript-DataFormatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2FExcel-Style-Javascript-DataFormatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fakundo","download_url":"https://codeload.github.com/fakundo/Excel-Style-Javascript-DataFormatter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fakundo%2FExcel-Style-Javascript-DataFormatter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265220054,"owners_count":23729751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T16:18:00.314Z","updated_at":"2025-10-25T05:04:00.721Z","avatar_url":"https://github.com/fakundo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Excel-Style Javascript Data Formatter\n\n[![npm](https://img.shields.io/npm/v/excel-style-dataformatter.svg?maxAge=2592000)](https://www.npmjs.org/package/excel-style-dataformatter)\n\n## Current version supports\n- Number formatting (decimal form, fractional form, percents, etc.)\n- Date formatting (elapsed time, am/pm)\n- Predefined excel formats (Fixed, Standard, etc.)\n- Localization\n\n# Install\n\n```\nnpm install excel-style-dataformatter\n```\n\n```\nbower install excel-style-dataformatter\n```\n\n# Usage\n\n## CommonJS\n\n```js\nimport DataFormatter from 'excel-style-dataformatter';\nconst dataFormatter = new DataFormatter();\nconst result = dataFormatter.format('99', 'Number', 'Currency');\n```\n\n#### With locales\n```js\nimport DataFormatter from 'excel-style-dataformatter';\nimport ru from 'excel-style-dataformatter/lib/ru';\n\n// Create instance with defined locales\nconst options = { locales: [ru] };\nconst dataFormatter = new DataFormatter(options);\n\n// Switch locale\ndataFormatter.setLocale('ru');\n\nconst result = dataFormatter.format('99', 'Number', 'Currency');\n```\n\n## Browser\n\n```html\n\u003cscript src=\"excel-style-dataformatter/lib/index.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"excel-style-dataformatter/lib/locales/ru.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  // Create instance\n  var dataFormatter = new window.DataFormatter({\n    locales: [window.DataFormatter_ru]\n  });\n\n  // Default locale\n  document.write(dataFormatter.format('123.44', 'Number', 'Currency').value);\n\n  // Switch to russian\n  dataFormatter.setLocale('ru');\n  document.write(dataFormatter.format('123.44', 'Number', 'Currency').value);\n\u003c/script\u003e\n```\n\n## AMD\n\n```html\n\u003cscript\u003e\n  require(['excel-style-dataformatter/lib/index', 'excel-style-dataformatter/lib/locales/ru'], function() {\n\n    require(['DataFormatter', 'DataFormatter_ru'], function(DataFormatter, ru) {\n      // Create instance\n      var dataFormatter = new DataFormatter({ \n        locales: [ru] \n      });\n\n      // Default locale\n      document.write(dataFormatter.format('99', 'Number', 'Currency').value);\n\n      // Switch to russian\n      dataFormatter.setLocale('ru');\n      document.write(dataFormatter.format('99', 'Number', 'Currency').value);\n    });\n\n  });\n\u003c/script\u003e\n```\n\n# Available options\n```\nlocale {string} - default locale\nlocales {string} - defined locales\nUTCOffset {number|null} - UTC offset for dates in minutes\ntransformCode {function}\ndebug {boolean}\n```\n\n# API\n\n* `.format(value, type, format)`\n* `.defineLocales(locales)`\n* `.setLocale(locale)`\n* `.setUTCOffset(offset)`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Fexcel-style-javascript-dataformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffakundo%2Fexcel-style-javascript-dataformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakundo%2Fexcel-style-javascript-dataformatter/lists"}