Bangla.net 0.1.0

There is a newer version of this package available.
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
                    
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="Bangla.net" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bangla.net" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Bangla.net" />
                    
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 Bangla.net --version 0.1.0
                    
#r "nuget: Bangla.net, 0.1.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.
#:package Bangla.net@0.1.0
                    
#: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=Bangla.net&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Bangla.net&version=0.1.0
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.

Version Downloads Last Updated
0.1.1 161 6/17/2025
0.1.0 99 5/10/2025