millify 1.0.3
dotnet add package millify --version 1.0.3
NuGet\Install-Package millify -Version 1.0.3
<PackageReference Include="millify" Version="1.0.3" />
<PackageVersion Include="millify" Version="1.0.3" />
<PackageReference Include="millify" />
paket add millify --version 1.0.3
#r "nuget: millify, 1.0.3"
#:package millify@1.0.3
#addin nuget:?package=millify&version=1.0.3
#tool nuget:?package=millify&version=1.0.3
millify-dotnet 📊
About Millify-Dotnet 📜
Millify-Dotnet is a lightweight and easy-to-use .NET library designed to convert long, unwieldy numbers into pretty, human-readable strings. Inspired by the popular millify NodeJS library, it simplifies the process of displaying large numbers in a clean and concise format. 🎯
Whether you're working with thousands, millions, or even trillions, Millify-Dotnet makes your numbers look neat and professional. Perfect for dashboards, reports, or any application where readability matters! ✨
Installation 📦
You can install Millify-Dotnet via NuGet using one of the following methods:
Package Manager
Install-Package millify
.NET CLI
dotnet add package millify
PackageReference
<PackageReference Include="millify" />
Usage 🛠️
Add the Namespace
Start by including the MillifyDotnet namespace in your code:
using MillifyDotnet;
Shorten Numbers
To convert a long number into a human-readable format, use the Shorten method:
var result = Millify.Shorten(2500);
// Output: 2.5K
result = Millify.Shorten(1024000);
// Output: 1.0M
Customize Output 🎨
Millify-Dotnet provides flexible options to tailor the output to your needs. Use the MillifyOptions class to configure the formatting:
Example 1: Custom Precision and Lowercase
var options = new MillifyOptions(precision: 3, lowercase: true);
var result = Millify.Shorten(1024000, options);
// Output: 1.024m
Example 2: Add Space and Custom Units
var options = new MillifyOptions(spaceBeforeUnit: true, units: new[] {"B", "KB", "MB", "GB", "TB"});
var result = Millify.Shorten(1440000, options);
// Output: 1.44 MB
Options ⚙️
The MillifyOptions class allows you to customize the output with the following properties:
| Name | Type | Default | Description |
|---|---|---|---|
Precision |
int |
1 |
Number of decimal places to display. |
Lowercase |
bool |
false |
Use lowercase abbreviations (e.g., 1.5k instead of 1.5K). |
SpaceBeforeUnit |
bool |
false |
Add a space between the number and the abbreviation (e.g., 1.5 K). |
Units |
string[] |
['', 'K', 'M', 'B', 'T', 'P', 'E'] |
Custom unit abbreviations to use for formatting. |
Why Use Millify-Dotnet? 🌟
- Simple and Intuitive: Convert numbers with just one method call.
- Customizable: Tailor the output to fit your needs with flexible options.
- Lightweight: Minimal overhead, maximum performance.
- Human-Readable: Make large numbers easy to understand at a glance.
License 📜
Millify-Dotnet is licensed under the MIT License. See the LICENSE file for more details.
Get Started Today! 🎉
Whether you're building a dashboard, generating reports, or just need to display large numbers in a clean format, Millify-Dotnet is here to help. Install the package, follow the examples, and start simplifying your numbers today! ⏱️
Happy Coding! 🚀
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard1.6 is compatible. netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 1.6
- No dependencies.
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- update dependencies