dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
599 stars 50 forks source link

Support for decimal on client side #433

Open kowalgta opened 9 years ago

kowalgta commented 9 years ago

It seems that currently WebSharper does not support decimal when generating Javascript from F#. While compiling I'm getting errors like:

error WebSharper: Failed to translate a method call.: MakeDecimal(..) [Microsoft.FSharp.Core.LanguagePrimitives+IntrinsicFunctions].
error WebSharper: Failed to translate a method call.: Parse(..) [System.Decimal].

Replacing decimal with float does the trick, though then I have to deal with float problems.

Is there a plan to add full support for decimal on client side ?

aph5nt commented 8 years ago

whats the status of this ?

atadi96 commented 7 years ago

I am working on a proxy for decimals, it will be part of the MathJS extension. Surprisingly, we need a new WebSharper compiler feature to make it work, because some of the IntrinsicFunctions module is already proxied in WebSharper, but then we can only proxy the MakeDecimal from the MathJS dll, and the current compiler doesn't support proxies split across multiple dll-s, but I've just submitted a PR with that feature.

With this, at least partial decimal support will be released very soon!