KP.ConverterLibrary 1.0.0

.NET 5.0
Install-Package KP.ConverterLibrary -Version 1.0.0
dotnet add package KP.ConverterLibrary --version 1.0.0
<PackageReference Include="KP.ConverterLibrary" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KP.ConverterLibrary --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: KP.ConverterLibrary, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install KP.ConverterLibrary as a Cake Addin
#addin nuget:?package=KP.ConverterLibrary&version=1.0.0

// Install KP.ConverterLibrary as a Cake Tool
#tool nuget:?package=KP.ConverterLibrary&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About

Useful numeric extensions created for teaching C# yet has many extensions that has real world application.

Numeric language extensions.

Int

Extension Description
Invert Flip negative to positive or positive to negative
IntToDecimal Convert int to decimal e.g. 25 will return .25
IsPositive Determine if value is positive
IsNegative Determine if value is negative
ToYesNoFormat Convert int to Yes/No (not constrained to 0 0r 1)
ToYesNo Formats an int as Yes/No (must be 0 or 1)
ToNullableInt Convert a string to a Nullable int or null
PercentDone Provide percent completed formatted nnn%

decimal

Extension Description
CountDecimalPlaces count decimals in the fraction part of a number
GetParts Get major and fraction parts of a double
Invert Flip negative to positive or positive to negative

double

Extension Description
PercentOf Calculates percentage of a number

String arrays to int arrays

Extension Description
AllInt Determine if all values can represent an int
ToIntegerArray Convert values in array to int array discards non int values in array.
AsIntegerArray
GetNonIntegerIndexes Get all non-integer positions/indices
ToIntegerPreserveArray Convert all values in array to int array where non int values will be set to the default value.
NoZeros Determine if all values are non-zero

String arrays to double arrays

Extension Description
AllDouble Determine if all values can represent a double
ToDoubleArray Convert values in array to double array discards non double values in array.
GetNonDoubleIndexes Get all non-double positions/indices
ToDoublePreserveArray Convert all values in array to double array where non double values will be set to the default value.

String arrays to decimal arrays

Extension Description
AllDecimal Determine if all values can represent a decimal
ToDecimalArray Convert values in array to decimal array discards non decimal values in array.
GetNonDecimalIndexes Get all non-decimal positions/indices
ToDecimalPreserveArray Convert all values in array to decimal array where non decimal values will be set to the default value.

Int Sequence extensions

Extension Description
IsSequenceBroken Determine if the sequence has missing elements
SequenceFindMissing Get missing elements used with IsSequenceBroken

TryParse

Extensions

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • 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.0 175 10/7/2021