Membership Fee 6 - UI Components & LiveViews closes #280 #304
1 changed files with 5 additions and 2 deletions
|
|
@ -28,8 +28,11 @@ defmodule MvWeb.Helpers.MembershipFeeHelpers do
|
|||
# Use German format: comma as decimal separator, always 2 decimal places
|
||||
# Normalize to 2 decimal places
|
||||
normalized = Decimal.round(amount, 2)
|
||||
normalized_str = Decimal.to_string(normalized, :normal)
|
||||
normalized_str = String.replace(normalized_str, ".", ",")
|
||||
normalized_str =
|
||||
normalized
|
||||
|> Decimal.to_string(:normal)
|
||||
|> String.replace(".", ",")
|
||||
|
||||
# Ensure 2 decimal places
|
||||
case String.split(normalized_str, ",") do
|
||||
[int_part, dec_part] when byte_size(dec_part) == 1 ->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue