OneBitSoftware.Slovom 1.2.0

dotnet add package OneBitSoftware.Slovom --version 1.2.0
                    
NuGet\Install-Package OneBitSoftware.Slovom -Version 1.2.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="OneBitSoftware.Slovom" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OneBitSoftware.Slovom" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="OneBitSoftware.Slovom" />
                    
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 OneBitSoftware.Slovom --version 1.2.0
                    
#r "nuget: OneBitSoftware.Slovom, 1.2.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 OneBitSoftware.Slovom@1.2.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=OneBitSoftware.Slovom&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=OneBitSoftware.Slovom&version=1.2.0
                    
Install as a Cake Tool

OneBitSoftware.Slovom

test alternate text is missing from this package README image alternate text is missing from this package README image

A .NET library that converts currency values into words in Bulgarian for accounting purposes.

Example BGN: Input: 32048.27 Output: тридесет и две хиляди и четиридесет и осем лева и 27 ст. Example EUR: Input: 32048.27 Output: тридесет и две хиляди и четиридесет и осем евро и 27 ц.

Functionality

  • It takes into consideration the grammatical gender.
  • It supports negative values.
  • It writes decimal fractions in the short form: X лева и ст. when the value is above zero, and the full word when it is under the value of 1: девет стотинки.
  • The current maximum value is 999999.99 and the minimum is -999999.99.

Supported currencies

The library supports the following currencies through predefined descriptors:

Currency Code Major Unit Minor Unit Usage
Bulgarian Lev BGN лев/лева стотинка/стотинки CurrencyDescriptor.Bgn
Euro EUR евро евроцент/евроцента CurrencyDescriptor.Euro

AI Story

This project is my first attempt to build something with GitHub Copilot, with as little intervention as possible. GitHub Copilot just couldn't understand my requirements thoroughly enough and it never gave something that satisfies all requirements together. I made many attempts to improve functions with detailed prompts, but code was always unsatisfactory. I did my best to not give up on it, however my patience was over at one point.

Generating InlineData for the tests failed into an infinite loop (and the token limits kicked in). Nothing generated as code passed all the tests no matter how I structured prompts. Prompting it to fix the code so tests pass never got the necessary results.

I eventually had to correct the code myself. The end result is an abomination, but it works. I still feel that I would have spent less time writing it from scratch.

Installation

You can install the OneBitSoftware.Slovom assembly through the NuGet package NuGet:

Install-Package OneBitSoftware.Slovom

Or via the .NET Core command line interface:

dotnet add package OneBitSoftware.Slovom

Examples

BGN examples

Input Output
0 нула лева
1 един лев
2 два лева
19 деветнадесет лева
0.1 десет стотинки
1.20 един лев и 20 ст.
1019.78 хиляда и деветнадесет лева и 78 ст.
1119.78 хиляда сто и деветнадесет лева и 78 ст.
2014.78 две хиляди и четиринадесет лева и 78 ст.
32478.27 тридесет и две хиляди четиристотин седемдесет и осем лева и 27 ст.

EURO examples

Input Output
0 нула евро
1 едно евро
2 две евро
19 деветнадесет евро
0.1 десет евроцента
1.20 едно евро и 20 ц.
1019.78 хиляда и деветнадесет евро и 78 ц.
1119.78 хиляда сто и деветнадесет евро и 78 ц.
2014.78 две хиляди и четиринадесет евро и 78 ц.
32478.27 тридесет и две хиляди четиристотин седемдесет и осем евро и 27 ц.

Contributing

Feel free to raise a PR to improve the code quality or add new features.

Credits

Inspired by:

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 is compatible.  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.
  • net9.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.2.0 146 1/19/2026
1.1.0 281 3/21/2025
1.0.1 256 3/10/2025
1.0.0 218 3/8/2025