Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

EUR(0.001234) becomes EUR(0.1234)??? #5

Closed
ghost opened this issue May 27, 2017 · 1 comment
Closed

EUR(0.001234) becomes EUR(0.1234)??? #5

ghost opened this issue May 27, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented May 27, 2017

Hi, I've the following small test example:

void main()
{
    alias EUR = currency!("EUR", 6);
    
    import std.stdio;
    writeln(EUR(0.001234));
}

But writeln() prints "0.1234EUR" instead of "0.001234EUR". I also tried writefln() but the result as the same. Am I doing something wrong?

qznc pushed a commit that referenced this issue May 28, 2017
Zeros after the dot were missing, so `EUR(0.001234)` was formatted as
`0.1234EUR` instead of `0.0012EUR`.

Fixes issue #5
@qznc
Copy link
Owner

qznc commented May 28, 2017

Thanks for reporting! The error was mine. The good thing is that only formatting was broken. The values are fine.

Fixed now.

@qznc qznc closed this as completed May 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant