ForNeVeR / ForNeVeR/tabularius

Use the number format from hledger for the amounts

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
F#
Stars
1
Forks
0
Avg merge
12h 14m
Merged PRs (30d)
10

Description

## Problem

The `AmountStyle` type does not have a decimal mark field and a digit groups field. `hledger` gives this data in `Hledger.Data.Types.AmountStyle`.

`Amount.ToString` makes the number text with `CultureInfo.CurrentCulture`. The program shows the decimal mark and the digit group marks of the current culture. These marks can be different from the marks in the journal file.

Do these steps:

1. Add a decimal mark field and a digit groups field to `AmountStyle`.
2. Get the values of these fields from `hledger` through the interop layer.
3. Use these values in `Amount.ToString`. Use the current culture only for a default value.

## Why this task is necessary

The user writes each amount in the journal file in a specific number format. `hledger` keeps this format and reports it. If Tabularius ignores this format, the program shows the amounts in a different format than the journal file. The user sees incorrect data.

## Code

- https://github.com/ForNeVeR/tabularius/blob/c72791e9b177ccc5bf44c4cbe66048605f2fe3c6/Tabularius.Data/BalanceReport.fs#L20-L27
- https://github.com/ForNeVeR/tabularius/blob/c72791e9b177ccc5bf44c4cbe66048605f2fe3c6/Tabularius.Data/BalanceReport.fs#L43-L52

Contributor guide

Open the contributing guide

Research direction

Start with Tabularius.Data/BalanceReport.fs at the referenced AmountStyle and Amount.ToString locations, then trace the interop layer that receives AmountStyle from hledger. Confirm how the decimal mark and digit groups values are represented before wiring them into formatting. Done means journal amounts use hledger's marks, with the current culture retained as the default.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
backend, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.