Bangla.net
0.1.0
See the version list below for details.
dotnet add package Bangla.net --version 0.1.0
NuGet\Install-Package Bangla.net -Version 0.1.0
<PackageReference Include="Bangla.net" Version="0.1.0" />
<PackageVersion Include="Bangla.net" Version="0.1.0" />
<PackageReference Include="Bangla.net" />
paket add Bangla.net --version 0.1.0
#r "nuget: Bangla.net, 0.1.0"
#:package Bangla.net@0.1.0
#addin nuget:?package=Bangla.net&version=0.1.0
#tool nuget:?package=Bangla.net&version=0.1.0
Bangla.net
A .NET library for numeric data and date data conversion to bangla language specific terms. Inspired from the python library bangla
Features
- convert roman number to bengali number
- convert georgian calendar to bangla calendar
Number
Number is a static class which is part of the bng
namespace. It provides 2 main functions with 1 more override for each. You can see the example to understand the usage.
using bng;
var banglaWord = Number.ToBanglaWord(10011111002548976);
// output : এক শত কোটি এগারো লক্ষ এগারো হাজার এক শত কোটি পঁচিশ লক্ষ আটচল্লিশ হাজার নয় শত ছিয়াত্তর
var banglaWord = Number.ToBanglaWord("10011111002548976");
// output : এক শত কোটি এগারো লক্ষ এগারো হাজার এক শত কোটি পঁচিশ লক্ষ আটচল্লিশ হাজার নয় শত ছিয়াত্তর
var banglaNum = Number.ToBanglaNumber(10011111002548976);
// output : ১০০১১১১১০০২৫৪৮৯৭৬
var banglaNum = Number.ToBanglaNumber("10011111002548976");
// output : ১০০১১১১১০০২৫৪৮৯৭৬
Calendar
Calendar is a static class which is part of the bng
namespace.
provides 1 main function with 2 more overrides. You can see the example to understand the usage. ToString()
is overriden to provide a cleaner output.
using System;
using bng;
var today = Calendar.GetBengaliDate();
Console.WriteLine(today.ToString());
// output : ১৬ (ষোলোই) বৈশাখ, ১৪৩২ বঙ্গাব্দ ; মঙ্গলবার, গ্রীষ্ম কাল ।
var thisDay = Calendar.GetBengaliDate(15, 8, 1995);
// output : ৩১ (একত্রিশে) শ্রাবণ, ১৪০২ বঙ্গাব্দ ; মঙ্গলবার, বর্ষা কাল ।
var maxDate = Calendar.GetBengaliDate(DateTime.MaxValue);
// output : ১৭ (সতেরোই) পৌষ, ৯৪০৬ বঙ্গাব্দ ; শুক্রবার, শীত কাল ।
Calendar Functions return a BengaliDateInfo
object. Currently this is a object to return the data in a organized way. No functions take the data as input. Perhaps a future implementation
// this is the structure of the object
{
"Date":"১৬",
"Month":"বৈশাখ",
"Year":"১৪৩২",
"Season":"গ্রীষ্ম",
"Weekday":"মঙ্গলবার",
"Ordinal":"ষোলোই"
}
tips
you may need to configure the json serializer to get correct bangla words output. or else it may print out as Unicode escaped characters
using System.Text.Encodings.Web;
using System.Text.Json;
using System.Text.Unicode;
var option = new JsonSerializerOptions
{
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
};
var today = Calendar.GetBengaliDate();
JsonSerializer.Serialize(today, option)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.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.