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

string to d-money #4

Closed
joelcnz opened this issue Feb 2, 2017 · 8 comments
Closed

string to d-money #4

joelcnz opened this issue Feb 2, 2017 · 8 comments
Assignees

Comments

@joelcnz
Copy link

joelcnz commented Feb 2, 2017

How do I take a string and convert it into the money number?

Example:

alias EUR = currency!("EUR");

EUR cost;
cost = EUR("1.23");
@qznc
Copy link
Owner

qznc commented Feb 4, 2017

You have to do it yourself, like EUR("1.23".to!float). That could be done for convenience, but I have to think about it. It might encourage subtle bugs.

@qznc qznc self-assigned this Feb 4, 2017
@joelcnz
Copy link
Author

joelcnz commented Apr 20, 2017

Yes, bugs. I have a money program (detailed book keeping). It loads off a configuration file and each cost has to be converted from a string!

@joelcnz
Copy link
Author

joelcnz commented Apr 20, 2017

A money library is a good idea. C# has it.

@joelcnz
Copy link
Author

joelcnz commented May 31, 2017

I've added GUI to my detailed book keeping program.

I'm still interested in this issue.

qznc added a commit that referenced this issue May 31, 2017
@qznc
Copy link
Owner

qznc commented May 31, 2017

Use v2.2.0 and EUR("1.23") works. If not you can reopen this issue.

Tenacity seems to work. 😄

@qznc qznc closed this as completed May 31, 2017
@joelcnz
Copy link
Author

joelcnz commented Jun 1, 2017

Thanks, qznc.

What is Tenacity?

@qznc
Copy link
Owner

qznc commented Jun 1, 2017

te·na·cious Extremely persistent in adhering to or doing something; stubborn or relentless

@mw66
Copy link
Contributor

mw66 commented May 22, 2020

@joelcnz

the string ctor has bug, be careful!

#11

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

3 participants