c# - IFormatProvider with Integer value -


i have integer value in object. need cast integer value. have done way. system.convert.toint64(object) fxcop said need provide iformatprovider. string data type have no issue provide iformatprovider. how can provide iformatprovider integer value?

it depends on how need print value.

e.g. using:

var provider = system.globalization.cultureinfo.invariantculture; 

you string independent local (regional) settings.

using:

var provider = system.globalization.cultureinfo.currentculture; 

or:

var provider = system.globalization.cultureinfo.currentuiculture; 

instead, string printed using local (regional) machine settings.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

binding - How can you make the color of elements of a WPF DrawingImage dynamic? -

c# - How to add a new treeview at the selected node? -