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

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

c# - HwndSource win32 integration with Ribbons and KeyTips -