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 -

java - where to store the user credentials in an enterprise application(EAI)? -

java - netbeans "Please wait - classpath scanning in progress..." -