Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Decimal data type #681

Open
danrubel opened this Issue Dec 3, 2011 · 20 comments

Comments

Projects
None yet
6 participants
Member

danrubel commented Dec 3, 2011

[user feedback]
Please include decimal data type. Even if it will not work in Javascript, it will be better to contain it for compliles apps

Member

floitschG commented Dec 13, 2011

Not a VM bug.
Reassigning to library ('language' would be a good fit too).


Removed Area-VM label.
Added Area-Library label.

Member

floitschG commented Dec 20, 2011

Issue #916 has been merged into this issue.

Member

DartBot commented Aug 29, 2012

This comment was originally written by stevenc...@gmail.com


Has there been any progress on adding a Decimal data type to Dart? This is a very important feature. I imagine it can be implemented with guidance from the GWT team. They were able to implement the Java BigDecimal in JavaScript.

Member

DartBot commented Sep 10, 2012

This comment was originally written by jesse.ros...@gmail.com


Big mistake by not adding native decimal data type. This could have been easily converted to a custom Javascript class to handle it in Dart2js and would allow accurate currency code to exist in Dart. I use it all the time in a C# and VB. Apparently, they have smarter software engineers working at Microsoft. I'm sure Doug Crockford is laughing at you like he did with IBM screwing over the Javascript community over the same issue.

Let me guess, you will add it later casing apps to crash. Java all over again.

Member

DartBot commented Sep 10, 2012

This comment was originally written by ravi...@ravib.com


Please consider adding support for a Decimal type to Dart. It's crucial esp. for applications that deal with financial data. Thanks.

--Ravi B.

Member

DartBot commented Sep 10, 2012

This comment was originally written by jn13...@gmail.com


Having a natively suported decimal is essential to any big-boy application. During our product discovery phase we are heavily weighing the ability to handle decimals since this is still a flaw for web development... in 2012.

Member

DartBot commented Oct 21, 2012

This comment was originally written by casper...@gmail.com


We should definitely have a base10/decimal type in Dart. 0.1 + 0.2 != 0.3 is one of the most often reported bugs in JavaScript. Many modern languages have support for this and IEEE-754 semantics is first and foremost an implementation-optimization detail.

Member

DartBot commented Jan 20, 2013

This comment was originally written by briansmai...@gmail.com


As much as I thought Dart was fantastic (and still do), I didn't realise that num did not support decimal numbers. I realise that Dart must translate to JS, and I perhaps that is why there is no decimal type. As we all know, we need decimals for money. To code around this issue is a bad use of programmer resources, and is very inefficient. I think that if Dart wants respect as a language, it needs decimal types. I guess internally it would be an int with the precision stored. If this has not been addressed PLEASE do. I can't see why this could not be compatible with JS. There is probably only one other thing that I dislike about Dart (thus far) - mostly it's great including the ide/editor.

Member

DartBot commented Jan 20, 2013

This comment was originally written by @a14n


Until that issue is fixed, you can use the 'decimal' package I've just uploaded on pub ( http://pub.dartlang.org/packages/decimal )

Member

DartBot commented Jan 21, 2013

This comment was originally written by briansm...@gmail.com


@alexandre. Thanks for that info. I had written my own which is not as great as yours, but does what I need for currency. It appears plenty fast enough for client-side code (Stopwatch()). I'll be quite happy to throw it away when I presume decimal is implemented.

Member

DartBot commented Jan 21, 2013

This comment was originally written by jesse.r...@gmail.com


I think It's time we admit the obvious joke that Dart has become. How many
years before you can get a working product out the door?

No decimal data type means Dart is a joke written by people that don't
support real applications.

Sad, but maybe if people start telling Google the true, they may take
their head out of their ass.

Member

DartBot commented Jan 21, 2013

This comment was originally written by @ahmetaa


@jesse This is an issue tracker, not a place to vent or curse. Dart platform is being developed for maybe less than 2 years. I think current state of it is amazingly advanced comparing to other languages.
Besides, perhaps %1 of the applications rely on decimal types. And there are third party libraries available until it is implemented in Dart. Be patient.

Member

DartBot commented Jan 27, 2013

This comment was originally written by george.moschovi...@gmail.com


Please add a decimal data type.

Member

DartBot commented Jan 28, 2013

This comment was originally written by jesse.rose...@gmail.com


Good luck

Member

DartBot commented Mar 17, 2013

This comment was originally written by gursugu...@gmail.com


Could you please give us a timeframe like m4 or m5 for the implementation? I think the convenience of decimal operations are needed in more than 1% of applications.

Member

DartBot commented Jun 7, 2013

This comment was originally written by charlie...@kissintelligentsystems.com


A native decimal data type is absolutely essential. Having worked in both the C# and Java worlds I can, it is something that is really important to developers. It really should be implemented as a native data type not via a Pub Package.

Its something Javascript does very poorly and fits very well Darts mission of easing development of complex client side web apps.

Member

floitschG commented Jun 10, 2013

There is no plan to add decimals as numbers. We might eventually make a pub package (or take over Alexandre's if he is fine with that), though.
This will not happen before v1.


Added this to the Later milestone.

Member

DartBot commented Jun 10, 2013

This comment was originally written by @a14n


@florian no problem if it fits your needs.

Member

DartBot commented Jun 10, 2013

This comment was originally written by briansma...@gmail.com


@florian. It would be good to know why not after 1.0. Compared to
everything else that has been implemented in Dart, decimal does not seem
overly difficult. While I'm sure Alexandre's code is great, it would be
good to know what stops decimal being implemented in the language. I do
understand to some extent the JS conversion problems, however people
currently live with the limitations in JS. Then again, I'm not paying the
bills. PS: I think what you guys have done to-date is tremendous.

@lrhn lrhn added the core-m label Aug 11, 2017

@floitschG floitschG added core-n and removed core-m labels Aug 31, 2017

I'm amazed this isn't built into the language. This is my biggest disappointment as a newcomer to Dart. Dart is pitched as "batteries included" - but this gap makes that simply not true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment