[swift-users] Decimal to Double?

Alex Blewitt alblue at apple.com
Mon Nov 28 04:40:07 CST 2016


You can wrap it with an NSDecimalNumber, and then cast it to a Double from there:

Double(NSDecimalNumber(decimal:Decimal(1.0)))

Alex

> On 28 Nov 2016, at 10:13, Rick Mann via swift-users <swift-users at swift.org> wrote:
> 
> How do I get a Double from a Decimal?
> 
> TIA,
> 
> -- 
> Rick Mann
> rmann at latencyzero.com
> 
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161128/3141250c/attachment.html>


More information about the swift-users mailing list