This commit is contained in:
Craig Everett 2025-12-11 17:13:02 +09:00
parent 11730de24a
commit 5a145207da

View File

@ -34,12 +34,12 @@ price(Style, Pucks) ->
-spec price(Unit, Style, Pucks) -> Formatted
when Unit :: gaju | puck,
Style :: us | ch | jp | {Separator, Myriad},
Separator :: $, | $. | $_,
Myriad :: 3 | 4,
Pucks :: integer(),
Formatted :: string().
when Unit :: gaju | puck,
Style :: us | ch | jp | {Separator, Myriad},
Separator :: $, | $. | $_,
Myriad :: 3 | 4,
Pucks :: integer(),
Formatted :: string().
%% @doc
%% A simplified format function covering the most common formats desired.
@ -485,7 +485,12 @@ segment_jp(Format) ->
{error, format}
end.
read_segment(
read_segment([C | T], R, A) when $0 =< C andalso C =< $9 ->
N = C - $0,
read_segment(T, R, [NA);
read_segment([C | T], R, A) when $ =< C andalso C =< $ ->
assemble_jp({GajuSegments, PuckSegments}) ->
GajuString = lists:flatten(lists:map(fun expand_jp_myriad/1, GajuSegments)),