Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SharePoint - what type is Number field

I have a Field, that has Type="Number". What type of variables can I assign to it? Will the field support float or double?

oListItem["numberField"] = data;

What type can data be?

like image 731
Tschareck Avatar asked Jan 20 '26 23:01

Tschareck


1 Answers

All values that's string representation can be parsed as double, since SharePoint converts the input value to a string:

case SPFieldType.Number:
case SPFieldType.Currency:
  str1 = Convert.ToString(value, (IFormatProvider) CultureInfo.InvariantCulture);
  break;

(from SPListItem.SetValue(...))

You should be fine with string, int, double, etc.

like image 193
Stefan Avatar answered Jan 23 '26 15:01

Stefan



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!