[Answered ]-While import from excel, + sign is not inserted in number field, django

0๐Ÿ‘

โœ…

I converted data in string and concate + sign, but after concating it is appending .0 in each, number, So I used the split function and only get the value before. (dot).

here is my code

sms_no =  sheet.cell(r, 8).value
whtsp_no = sheet.cell(r, 9).value
sms1 = "+"+str(sms_no)
smsno = sms1.split(".")
finalsms = smsno[0]
whtsapp1 = "+"+str(whtsp_no)
whtsapno = whtsapp1.split(".")
finalwhtsap = whtsapno[0]
๐Ÿ‘คuser19491662

1๐Ÿ‘

You need to change field from some IntegerField to ChardField. Database treats integer +123 as simply positive number 123.

๐Ÿ‘คNixonSparrow

Leave a comment