webjose / wj.datatypes Goto Github PK
View Code? Open in Web Editor NEWUseful assorted data types.
License: MIT License
Useful assorted data types.
License: MIT License
Developer: webJose
Development Start Date: (start date in ISO8601)
Development End Date: (end date in ISO8601)
Class / Clase | Coverage (%) | Comments |
---|---|---|
Money |
*Ideal minimum coverage: 80%
Developer: webJose
Development Start Date: 2018-06-20
Development End Date: 2018-06-23
Add any general description, if applicable. / Agregue cualquier descripción general, si aplica.
Class / Clase | Coverage (%) | Comments |
---|---|---|
RowVersion | 56.28% | No testing for IConvertible. |
*Ideal minimum coverage: 80%
Describe the solution you'd like / Describa la solución que le gustaría
Create a Memory struct whose value is always stored in bytes in a long field member and whose ToString() can represent the value in various formats. For example, the value 1024 (bytes) could be shown as 1 KB, 1 KiB or 1024 B.
Ideally, it would also have a type converter for use of the value in PropertyGrid.
Developer: webJose
Development Start Date: 2018-06-20
Development End Date: 2018-06-20
Developer: webJose ([email protected])
Development Start Date: 2018-06-25
Development End Date: 2018-07-04
Binds a decimal
value with a string
value to fully describe a monetary value.
IFormatProvider
object) except for the currency symbol. Admits precision values.IFormatProvider
object). Admits precision values.IFormatProvider
object.IFormatProvider
object.For each CultureInfo
there are 0 or 1 RegionInfo
objects. The latter defines the 3-letter ISO currency code. There is a one-to-many relationship between the ISO currency code and cultures. The culture has the information to format the currency, so the consumer of the class will be given an opportunity to select it from the different possibilities. The consumer will be informed of the pre-selection, which is the current culture if possible.
The first choice would be the current culture if it is part of the possible selections for the specified currency. If not a possibility, then the first region-specific culture is selected. If there are no region-specific cultures, then the first available culture is selected.
A static event will allow consumers to override the selection.
Constructors that do not take a culture or a currency code default to the currency for the current culture. If so happens that the current culture does not have an associated RegionInfo
object, then the constructor cannot be used and another that takes a culture or a currency code must be used.
Describe the solution you'd like / Describa la solución que le gustaría
Money.Parse()
and Money.TryParse()
should work basically the same as Decimal.Parse()
and Decimal.TryParse()
.
It should be able to parse any and all ToString() outputs for all string formats defined, namely G, I, GO and IO with any number of decimals (precision).
Examples:
The following were generated using es-CR as the thread's current culture.
Description | G Format | I Format | GO Format | IO Format | Value |
---|---|---|---|---|---|
Korean Won | -₩16 161,00 | -16 161,00 KRW | -₩16,161 | 16,161 KRW | Sixteen thousand one hundred sixty one wons |
US Dollar | -$77 991,00 | -77 991,00 USD | ($77,991.00) | (77,991.00) USD | Seventy seven thousand nine hundred ninety one US dollars |
Additional context / Contexto adicional
Since Money is a union of a string and a decimal value, the heavy work can be delegated to the Decimal.Parse()
and Decimal.TryParse()
"standard" methods.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.