python: how to convert currency to decimal? -


i have dollars in string variable

dollars = '$5.99' 

how convert decimal instead of string can operations adding dollars it?

there's easy approach:

dollar_dec = float(dollars[1:]) 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -