Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Decimal data type #681

Open
danrubel opened this Issue · 19 comments

3 participants

@danrubel
Collaborator

[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

@floitschG
Collaborator

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


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

@floitschG
Collaborator

Issue #916 has been merged into this issue.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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 )

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@DartBot
Collaborator

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


Please add a decimal data type.

@DartBot
Collaborator

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


Good luck

@DartBot
Collaborator

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.

@DartBot
Collaborator

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.

@floitschG
Collaborator

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.

@DartBot
Collaborator

This comment was originally written by @a14n


@florian no problem if it fits your needs.

@DartBot
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.