Skip to content

Commit

Permalink
Merge 18be992 into d1cc521
Browse files Browse the repository at this point in the history
  • Loading branch information
TotalVerb committed May 13, 2017
2 parents d1cc521 + 18be992 commit 879abf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CurrencyFormatting/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function render(template::Vector, spec::FormatSpecification, m::Monetary)
digisep = get(spec, DigitSeparator, DigitSeparator(""))

prec = decimals(m)
intpart = trunc(Int, abs(m.val))
floatpart = round(Int, big(10)^prec * (abs(m.val) - intpart))
intpart = trunc(BigInt, abs(m.val))
floatpart = round(BigInt, big(10)^prec * (abs(m.val) - intpart))

syms = getsymboltable(spec)
next_template = []
Expand Down
3 changes: 3 additions & 0 deletions test/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,7 @@ end # testset output
# can't combine US & european
@test_throws Currencies.DeclarativeFormatting.IncompatibleFormatException format(
USD, styles=[:us, :european])

# big numbers
@test format(Monetary{:USD,BigInt,10}(1e4)) == "10000.0000000000 USD"
end

0 comments on commit 879abf2

Please sign in to comment.