Suren37.Utils.NepaliTools 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Suren37.Utils.NepaliTools --version 1.0.0                
NuGet\Install-Package Suren37.Utils.NepaliTools -Version 1.0.0                
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="Suren37.Utils.NepaliTools" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Suren37.Utils.NepaliTools --version 1.0.0                
#r "nuget: Suren37.Utils.NepaliTools, 1.0.0"                
#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.
// Install Suren37.Utils.NepaliTools as a Cake Addin
#addin nuget:?package=Suren37.Utils.NepaliTools&version=1.0.0

// Install Suren37.Utils.NepaliTools as a Cake Tool
#tool nuget:?package=Suren37.Utils.NepaliTools&version=1.0.0                

Introduction

A C# library to convert between English date and number format to nepali system. Previous users of 'suren37.Library.AmountToWord' and 'suren37.Library.NepaliDate' can use this library as this will be favoured more for development.

Getting Started

1. Install Package

Install-Package Suren37.Utils.NepaliTools -Version 1.0.0

2. Adding namespace

using Suren37.Utils.NepaliTools; 

3. How to convert nepali date to english date and vice versa

Convert from english date to nepali date(AD to BS)

var currentDate = new System.DateTime.Today.Date;
var nepaliDate = currentDate.GetNepaliDate(); // Return INepaliDate object having properties like Day, Month, Year, ... in Nepali(BS) format

Convert from nepali date to english date (BS to AD)

var englishDate = nepaliDate.GetEnglishDate();                         // From INepaliDate object
var englishDate2 = NepaliDateExtensions.ConvertToEnglish(2070, 1, 1);  // From year, month and date

Limitations

  • Can convert between dates (1944 - 2033) in AD only
  • Can convert between dates (2000 - 2089) in BS only

4. How to convert number to number with comma according to nepali system and in words

Creating number text with comma

var number = 123456789;
string numberWithComma = number.WithComma();            // Output: 12,34,56,789
var floatingNumber = 123456.78; 
string numberWithComma2 = floatingNumber.WithComma();   //Output: 1,23,456.78

Create NumberText instance

var numberText = new NumberText();  // You can define it with various properties, explore it :)
numberText.WholeUnit = "Rupees";
numberText.FractionUnit = "Paisa";
numberText.Precision = 2;
numberText.ShowOnly = true;

Convert numerals into words var number = 123456789; var floatingNumber = 1234567.89;

var numberInWords = numberText.GetInWords();        // Output: Twelve Crore Thirty Four Lakh Fifty Six Thousand Seven Hundred Eighty Nine Rupees Only
var numberInWords2 = floatingNumber.GetInWords();   // Output: Twelve Lakh Thirty Four Thousand Five Hundred Sixty Seven Rupees and Eighty Nine Paisa Only

Limitations

  • For in words conversions limits are: -999999999999999999 to 999999999999999999
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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.1 1,116 4/25/2020
1.0.0 1,082 8/25/2019

1. Convert number to nepal comma system
2. Convert number to word in nepali system
3. Convert between english date and nepali date