Suren37.Utils.NepaliTools
1.0.0
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
<PackageReference Include="Suren37.Utils.NepaliTools" Version="1.0.0" />
paket add Suren37.Utils.NepaliTools --version 1.0.0
#r "nuget: Suren37.Utils.NepaliTools, 1.0.0"
// 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 | Versions 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. |
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.
1. Convert number to nepal comma system
2. Convert number to word in nepali system
3. Convert between english date and nepali date