D7: убрать дрейф в комментариях и docstring
- infrastructure/repositories/excel_repository.py: docstring обещал «5 листов» — фактически 6 листов данных (Accounts, Transactions, Recurring, Assets, Liabilities, ExchangeRates) + служебный ModelInfo; перечислены явно - domain/currency.py: комментарий «Internal arithmetic keeps full Decimal precision» не соответствовал коду — convert() квантует до 2 знаков (ROUND_HALF_UP) независимо от числа знаков валюты; поведение не менялось, комментарий теперь описывает факт (изменение — Tier 2, D15) - infrastructure/cli/services.py: docstring fmt_amount утверждал, что symbol «retained for backward compatibility»; на деле параметр просто не читается — теперь это сказано прямо Поведение кода не изменено (только комментарии и docstring).
This commit is contained in:
1 parent
2691bcd3cb
commit
339a751153
3 files changed
+14
-6
No files matched your search
+4
-2
@@ -15,8 +15,10 @@ CURRENCY_SYMBOLS = {
|
||||
|
||||
# ISO 4217 minor units per currency (https://en.wikipedia.org/wiki/ISO_4217).
|
||||
# Keys are uppercase 3-letter codes, values are the number of decimal digits used
|
||||
# when DISPLAYING the currency. Internal arithmetic keeps full Decimal precision
|
||||
# (do not modify — see T8 decision `internal_precision`).
|
||||
# when DISPLAYING the currency. Дисплейное округление задаётся здесь и НЕ равно
|
||||
# точности внутренней арифметики: `convert()` квантует результат до 2 знаков
|
||||
# (`Decimal("0.01")`, ROUND_HALF_UP) независимо от числа знаков валюты.
|
||||
# Изменение этого поведения — Tier 2 (D15), сейчас оно зафиксировано как есть.
|
||||
#
|
||||
# - 0 decimals: JPY (Japanese yen)
|
||||
# - 2 decimals: most currencies (RUB, USD, EUR, GBP, CNY, KZT, UAH, ...)
|
||||
|
||||
@@ -55,8 +55,10 @@ def convert_value(converter: CurrencyConverter, amount: Decimal, from_curr: str,
|
||||
def fmt_amount(amount: Decimal | float, currency: str, symbol: str = "") -> str:
|
||||
"""Format money via the canonical display rule.
|
||||
|
||||
`symbol` is retained as a positional parameter for backward compatibility with
|
||||
existing callers (compare.py / forecast.py / scenario.py / whatif.py); the
|
||||
symbol/layout decision is centralised in `CurrencyConverter.format_money`.
|
||||
`symbol` НЕ читается: символ и раскладку определяет
|
||||
`CurrencyConverter.format_money` по коду валюты. Параметр оставлен только
|
||||
ради совместимости с существующими вызовами
|
||||
(compare.py / forecast.py / scenario.py / whatif.py), которые передают его
|
||||
позиционно.
|
||||
"""
|
||||
return CurrencyConverter.format_money(amount, currency)
|
||||
@@ -1,4 +1,8 @@
|
||||
"""ExcelRepository — хранит FinancialModel в .xlsx (5 листов + ModelInfo)."""
|
||||
"""ExcelRepository — хранит FinancialModel в .xlsx (6 листов данных + ModelInfo).
|
||||
|
||||
Листы данных: Accounts, Transactions, Recurring, Assets, Liabilities,
|
||||
ExchangeRates. Плюс служебный лист ModelInfo (base_currency).
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
from uuid import UUID
|
||||
|
||||
Reference in new issue
Block a user