ForNeVeR / ForNeVeR/tabularius

Put a space between the commodity symbol and the quantity

Open Beginner friendly
#73 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 has a `CommoditySpaced` field. `Amount.ToString` does not read this field. The method puts the commodity symbol directly before the quantity or directly after the quantity. The method never puts a space between these two parts.

Do these steps:

1. Read `AmountStyle.CommoditySpaced` in `Amount.ToString`.
2. Put one space between the commodity symbol and the quantity if the value of the field is `true`.
3. Correct the tests in `Tabularius.Tests/Data/AmountTests.fs`. These tests hold the current behavior.

## Why this task is necessary

`hledger` reports the space in the amount style. The interop layer keeps this data, and `Tabularius.Tests/Interop/BalanceReportTests.fs` shows the value. The program then removes the space when it shows the amount. The user sees `100USD` in place of `100 USD`.

## Code

- https://github.com/ForNeVeR/tabularius/blob/c72791e9b177ccc5bf44c4cbe66048605f2fe3c6/Tabularius.Data/BalanceReport.fs#L35-L41

Contributor guide

Open the contributing guide

Research direction

Start in Amount.ToString, using AmountStyle.CommoditySpaced and the referenced BalanceReport.fs lines to trace the formatting. Update the expectations in Tabularius.Tests/Data/AmountTests.fs, and use Tabularius.Tests/Interop/BalanceReportTests.fs to confirm the spaced style is preserved. Done means a true value produces one space between the commodity symbol and quantity.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.