Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot specify a culture in string conversion explicitly when converting nullable decimal (decimal?) to string

Tags:

I have a property:

public decimal? DejanskaKolicina { get; set; }

and Resharper shows me:

specify a culture in string conversion explicitly

But if I use:

DejanskaKolicina.ToString(CultureInfo.CurrentCulture) 

I always get the message that:

ToString method has 0 parameter(s) but it is invoked with 1 arguments

If I change the decimal property so that it is no longer nullable then it works. How do I use ToString(CultureInfo.CurrentCulture) on nullable property?


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!