Convert from Price

Posted by Leroy Jenkins on Stack Overflow See other posts from Stack Overflow or by Leroy Jenkins
Published on 2010-06-07T22:17:32Z Indexed on 2010/06/07 22:22 UTC
Read the original article Hit count: 350

Filed under:
|

Im attempting to Convert a Price (from an API (code below)).

public class Price
{
    public Price();
    public Price(double data);
    public Price(double data, int decimalPadding);
}

What I would like to do is compare the price from this API to a Double. Simply trying to convert to Double isnt working as I would have hoped.

Double bar = 21.75;

if (Convert.ToDouble(apiFoo.Value) >= bar) {
//code
}

when I try something like this, I believe it says the value must be lower than infinity.

How can I convert this price so they can be compared?

© Stack Overflow or respective owner

Related posts about convert

Related posts about c#4.0