Guys, importing data from CSV, amongst them there is a field which contain a price but the price is not just a numbers but also currency sign.
So I was trying to remove this sign using replace, trim, re etc but it won't go away :)
The reason why I would like to remove is the field total_price is a float type so I can't write non float values.
How can I do it, how to remove it ?
total_price = record.total_price.replace('£','')
print ' Total price :',total_price
vat_rate = record.included_vat_rate
print ' VAT rate :',vat_rate
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 3/2/16, 11:56 AM|
|Seen: 291 times|
|Last updated: 3/3/16, 4:05 AM|