millify 1.0.3

dotnet add package millify --version 1.0.3
                    
NuGet\Install-Package millify -Version 1.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="millify" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="millify" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="millify" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add millify --version 1.0.3
                    
#r "nuget: millify, 1.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package millify@1.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=millify&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=millify&version=1.0.3
                    
Install as a Cake Tool

millify-dotnet 📊

Build, Test & Coverage codecov License: MIT NuGet Version


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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last Updated
1.0.3 89 2/28/2026
1.0.2 271 6/13/2024
1.0.1 8,398 6/4/2023
1.0.0 305 6/4/2023

- update dependencies