Soenneker.Extensions.Decimal 4.0.623

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Decimal --version 4.0.623
                    
NuGet\Install-Package Soenneker.Extensions.Decimal -Version 4.0.623
                    
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="Soenneker.Extensions.Decimal" Version="4.0.623" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Decimal" Version="4.0.623" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Decimal" />
                    
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 Soenneker.Extensions.Decimal --version 4.0.623
                    
#r "nuget: Soenneker.Extensions.Decimal, 4.0.623"
                    
#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 Soenneker.Extensions.Decimal@4.0.623
                    
#: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=Soenneker.Extensions.Decimal&version=4.0.623
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Decimal&version=4.0.623
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.Decimal

A collection of useful Decimal extension methods.

Installation

dotnet add package Soenneker.Extensions.Decimal

Quick start

using Soenneker.Extensions.Decimal;

// Given an existing decimal? named value:
var result = value.ToCurrencyDisplay();

Common operations

  • ToCurrencyDisplay() - Converts a nullable decimal value to its currency string representation, optionally omitting decimal places.
  • ToCurrency() - Rounds a decimal value to a specified number of decimal places suitable for currency representation. This method uses midpoint rounding to even, which is the default rounding mode for financial calculations.
  • ToPercentDisplay() - Formats the specified decimal value as a percentage string with up to two decimal places.
  • ToDouble() - Converts the specified decimal value to its equivalent double-precision floating-point representation.
  • ToRounded() - Rounds the specified decimal value to a given number of fractional digits using banker's rounding (MidpointRounding.ToEven).
  • ToInt() - Converts the specified decimal value to a 32-bit signed integer.
  • SafeDivision() - Divides the specified numerator by the denominator, returning zero if the denominator is zero. This method provides a safe alternative to standard division by avoiding exceptions when dividing by zero.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Soenneker.Extensions.Decimal:

Package Downloads
Soenneker.Extensions.Float

A collection of useful floating point extension methods

Soenneker.Utils.Math

Some useful math related utility methods

Soenneker.Stripe.Extensions.Decimals

Estimates card and ACH fees, net proceeds, gross-up amounts, and fee breakdowns using configurable package assumptions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.640 309 11/18/2026
11.0.639 340 11/11/2026
11.0.638 167 11/10/2026
11.0.637 598 10/26/2026
4.0.636 871 10/14/2026
4.0.635 175 10/14/2026
4.0.630 200 10/12/2026
4.0.629 153 10/12/2026
4.0.628 207 10/11/2026
4.0.627 616 9/24/2026
4.0.626 477 9/15/2026
4.0.625 272 9/12/2026
4.0.624 420 8/30/2026
4.0.623 208 8/29/2026
4.0.622 966 7/27/2026
4.0.621 498 7/16/2026
4.0.620 1,146 6/18/2026
4.0.619 696 6/5/2026
4.0.617 1,351 3/12/2026
4.0.616 192 3/12/2026
Loading failed

Improve README documentation