update tsconfig
This commit is contained in:
parent
905f3c41e9
commit
9380682293
@ -7,14 +7,24 @@
|
||||
"shortDescription": "handle monetary values",
|
||||
"npmPackagename": "@push.rocks/smartmoney",
|
||||
"license": "MIT",
|
||||
"projectDomain": "push.rocks"
|
||||
"projectDomain": "push.rocks",
|
||||
"description": "A library for handling monetary values effectively.",
|
||||
"keywords": [
|
||||
"monetary",
|
||||
"currency",
|
||||
"finance",
|
||||
"number parsing",
|
||||
"value handling",
|
||||
"TypeScript",
|
||||
"npm package"
|
||||
]
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": [],
|
||||
"npmAccessLevel": "public"
|
||||
},
|
||||
"tsdocs": {
|
||||
"tsdoc": {
|
||||
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||
}
|
||||
}
|
11
package.json
11
package.json
@ -2,7 +2,7 @@
|
||||
"name": "@push.rocks/smartmoney",
|
||||
"version": "1.0.6",
|
||||
"private": false,
|
||||
"description": "handle monetary values",
|
||||
"description": "A library for handling monetary values effectively.",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"author": "Lossless GmbH",
|
||||
@ -30,5 +30,14 @@
|
||||
"cli.js",
|
||||
"npmextra.json",
|
||||
"readme.md"
|
||||
],
|
||||
"keywords": [
|
||||
"monetary",
|
||||
"currency",
|
||||
"finance",
|
||||
"number parsing",
|
||||
"value handling",
|
||||
"TypeScript",
|
||||
"npm package"
|
||||
]
|
||||
}
|
1
readme.hints.md
Normal file
1
readme.hints.md
Normal file
@ -0,0 +1 @@
|
||||
|
89
readme.md
89
readme.md
@ -1,26 +1,79 @@
|
||||
# @pushrocks/smartmoney
|
||||
# @push.rocks/smartmoney
|
||||
handle monetary values
|
||||
|
||||
## Availabililty and Links
|
||||
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartmoney)
|
||||
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartmoney)
|
||||
* [github.com (source mirror)](https://github.com/pushrocks/smartmoney)
|
||||
* [docs (typedoc)](https://pushrocks.gitlab.io/smartmoney/)
|
||||
## Install
|
||||
To start using `@push.rocks/smartmoney`, you'll first need to install it using npm. Run the following command in your terminal:
|
||||
|
||||
## Status for master
|
||||
[![build status](https://gitlab.com/pushrocks/smartmoney/badges/master/build.svg)](https://gitlab.com/pushrocks/smartmoney/commits/master)
|
||||
[![coverage report](https://gitlab.com/pushrocks/smartmoney/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartmoney/commits/master)
|
||||
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartmoney.svg)](https://www.npmjs.com/package/@pushrocks/smartmoney)
|
||||
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartmoney/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartmoney)
|
||||
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
|
||||
```bash
|
||||
npm install @push.rocks/smartmoney --save
|
||||
```
|
||||
|
||||
This will add `@push.rocks/smartmoney` to your project's dependencies. Now, you're ready to use it in your TypeScript projects.
|
||||
|
||||
## Usage
|
||||
The main functionality of `@push.rocks/smartmoney` is to handle monetary values effectively, focusing on common tasks such as parsing European numeric strings which may include commas for decimal points and periods for thousands separators. In financial applications, or any software that deals with monetary input in a European format, `@push.rocks/smartmoney` can be extremely useful.
|
||||
|
||||
For further information read the linked docs at the top of this readme.
|
||||
### Basic Example: Parsing European Number Strings
|
||||
To demonstrate the basic functionality of `@push.rocks/smartmoney`, consider the task of converting a European-formatted string that represents a monetary value into a number that JavaScript can work with.
|
||||
|
||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||
The core aspect of `@push.rocks/smartmoney` you'll be using for this is `parseEuropeanNumberString` function. Here's how you can use it:
|
||||
|
||||
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)
|
||||
```typescript
|
||||
import { parseEuropeanNumberString } from '@push.rocks/smartmoney';
|
||||
|
||||
const exampleString = '1.234,56'; // A typical European formatted number string
|
||||
const resultNumber = parseEuropeanNumberString(exampleString);
|
||||
console.log(resultNumber); // Logs: 1234.56
|
||||
```
|
||||
|
||||
This simple example highlights how to convert a string like `'1.234,56'`, which is common in many European countries, into a floating-point number that JavaScript can recognize and work with (`1234.56`).
|
||||
|
||||
### Advanced Usage: Integrating with Financial Calculations
|
||||
Assuming you're building a financial application, handling user inputs in various formats might be a common task. For such scenarios, `@push.rocks/smartmoney` can help parse these inputs accurately before performing any calculations.
|
||||
|
||||
Let's consider you're calculating the total value of a portfolio in euros, based on user inputs that could be formatted in European style:
|
||||
|
||||
```typescript
|
||||
import { parseEuropeanNumberString } from '@push.rocks/smartmoney';
|
||||
|
||||
// User inputs, possibly fetched from a UI layer
|
||||
const inputs = ['1.000,50', '2.500,00', '3.000,25'];
|
||||
|
||||
// Parsing and summing up the total
|
||||
const total = inputs.reduce((acc, currentValue) => {
|
||||
return acc + parseEuropeanNumberString(currentValue);
|
||||
}, 0);
|
||||
|
||||
console.log(`Total Portfolio Value: €${total.toFixed(2)}`);
|
||||
// Logs: Total Portfolio Value: €6500.75
|
||||
```
|
||||
|
||||
In this more practical example, `@push.rocks/smartmoney` ensures that each user input is correctly parsed to a float, regardless of its original format, enabling accurate and reliable financial calculations.
|
||||
|
||||
### Conclusion and Further Applications
|
||||
While the examples provided here showcase basic usage and a more integrated scenario, `@push.rocks/smartmoney` can be deepened further into any financial or data processing application requiring precise handling of monetary formats, especially those catering to users in European countries.
|
||||
|
||||
The clear and straightforward API of `@push.rocks/smartmoney` allows for seamless integration into existing projects, making it easier for developers to focus on the core functionality of their applications without worrying about the nuances of handling monetary values.
|
||||
|
||||
As part of your project's evolution, consider contributing to `@push.rocks/smartmoney`'s development or sharing your use cases, helping the library to grow and support even more scenarios beneficial to the developer community.
|
||||
|
||||
> Note: The usage examples provided are simplified to demonstrate the capabilities of `@push.rocks/smartmoney`. For further exploration and advanced features, dive into the source code and documentation.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
|
Loading…
Reference in New Issue
Block a user