formatters #14
@ -34,12 +34,12 @@ price(Style, Pucks) ->
|
|||||||
|
|
||||||
|
|
||||||
-spec price(Unit, Style, Pucks) -> Formatted
|
-spec price(Unit, Style, Pucks) -> Formatted
|
||||||
when Unit :: gaju | puck,
|
when Unit :: gaju | puck,
|
||||||
Style :: us | ch | jp | {Separator, Myriad},
|
Style :: us | ch | jp | {Separator, Myriad},
|
||||||
Separator :: $, | $. | $_,
|
Separator :: $, | $. | $_,
|
||||||
Myriad :: 3 | 4,
|
Myriad :: 3 | 4,
|
||||||
Pucks :: integer(),
|
Pucks :: integer(),
|
||||||
Formatted :: string().
|
Formatted :: string().
|
||||||
%% @doc
|
%% @doc
|
||||||
%% A simplified format function covering the most common formats desired.
|
%% A simplified format function covering the most common formats desired.
|
||||||
|
|
||||||
@ -485,7 +485,12 @@ segment_jp(Format) ->
|
|||||||
{error, format}
|
{error, format}
|
||||||
end.
|
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 $0 =< C andalso C =< $9 ->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
assemble_jp({GajuSegments, PuckSegments}) ->
|
assemble_jp({GajuSegments, PuckSegments}) ->
|
||||||
GajuString = lists:flatten(lists:map(fun expand_jp_myriad/1, GajuSegments)),
|
GajuString = lists:flatten(lists:map(fun expand_jp_myriad/1, GajuSegments)),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user