SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

Cross posted from StackOverflow

share|improve this question
FYI... We try to avoid cross posting questions between sites because it is difficult for future visitors to find information scattered across multiple sites. In the future, can you try posting on one site first? In this case, you got two completely different answers so I guess I'll leave it here. – Kit Menke Apr 18 '12 at 13:41
up vote 3 down vote accepted

Could be Double or Decimal or Integer.

Use the ParseAndSetValue method to make sure it converts it to Double (see here

share|improve this answer
... or string. Also keep in mind that ParseAndSetValue is SP2010 specific method. – Vedran Rasol Apr 18 '12 at 10:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.