When trying to import a CSV file to Drupal using mapping, the text fields import correctly, but numbers (decimals) do not. I created a Decimal field, with 10 characters total and 2 to the right of the decimal separator. The numbers in my csv file vary from 4 characters total to 8 total, and from 0 to 2 digits to the right of the separator.

I tried cross-changing commas to periods in the csv file, and swapping Decimal separator and comma in the field properties. Nothing worked.

the numbers do import correctly when mapping to a text field.

Comments

itamair’s picture

I really subscribe …
Actually I can't import decimal numbers with feeds and feeds tamper into a decimal field in Drupal. No way …
Any thread for the for the solution?

Lissy’s picture

I have the same problem.
I tried using tampers "Format a number"-plugin without success.

itamair’s picture

Ok. I fixed my problem. Wasn't due to Feeds Module, but to its connected Feeds Sql one, I am using to fetch data.
The matter, for me, was caused by the field names in the source table that were written in capital letters. This cause the values to be imported as null.
Luckily there is an issue on this and an advised workaround here: http://drupal.org/node/1763872

gdarends’s picture

I'm also experiencing same issue. But I'm not using Feeds SQL so it's unrelated to that.
I do use Feeds Tamper but not on the decimal field where it's not working.

de_chris’s picture

I'm experiencing this problem when using a decimal with a comma e.g. "1,5€" doesn't work while "1.5€" works fine.
So changing to "english style" for storage and "german style" in the display options is an option.

parisek’s picture

Version: 7.x-2.0-alpha5 » 7.x-2.0-beta1
Issue summary: View changes
Status: Active » Closed (works as designed)

I think, this is fixed now. If your decimal separator is comma, use Feeds Tamper to find & replace with dot. Everything works fine for me after that. If this is not working check if is your CSV file correct eg. remove whitespace between numbers