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?
That particular
ToString
overload only exists for adecimal
, so you can make it work by only calling it for adecimal
: