Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.076 X-Spam-Evidence: '*H*': 0.85; '*S*': 0.00; 'suggest': 0.14; 'format?': 0.16; 'storing': 0.16; 'url:decimal': 0.16; 'sender:addr:gmail.com': 0.17; 'fix': 0.17; 'wrote:': 0.18; 'module': 0.19; 'finally,': 0.24; 'module,': 0.24; 'read,': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'decimal': 0.31; 'anyone': 0.31; 'probably': 0.32; 'url:python': 0.33; 'to:name:python-list': 0.33; 'subject:with': 0.35; 'point.': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'doubt': 0.36; 'method': 0.36; 'url:org': 0.36; 'url:library': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'even': 0.60; 'august': 0.61; 'url:3': 0.61; '18:47,': 0.84; 'primer': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=OsmyuaP9OeVT6DNSpq+f1sVhbftX51y2USS5rEflEVY=; b=lG8vp3Hq0GpDq1RZ9oM7lGdHKmcRbzEuHJReg9Z9iMEMoNL/wlqVIeBezkEUxHJSYB fFOxOWJU+yWJhoiDV8qRnE5Oq2X/b8Zemxj7VEtEupWPxhrKuyrnG33ejFRUlUrbqEOB B8lON+NN4SqqhpIF5xkjDk7XYvxkyWZkJm2bsLX7sAQpljL+PmlqXY0SHwZOJmDjprYn gbgscY2jITPj8yt1KM874iNS22gGk/HMzcCaVc1LJ6Wii3IxTkgwhuW6nUXzXCnAWxzb eUSDrtzMsfTykNODRnxfraKvSQxsOkLw/taWqBSlgMjA4u9d+UoIm93jr3PxayRsjIcJ UlMw== X-Received: by 10.112.149.36 with SMTP id tx4mr3811940lbb.79.1408830769097; Sat, 23 Aug 2014 14:52:49 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: References: From: Joshua Landau Date: Sat, 23 Aug 2014 22:52:09 +0100 X-Google-Sender-Auth: h8YTPIFAqnWDV4M2ca81lGrr7Ys Subject: Re: Working with decimals To: python-list Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408830777 news.xs4all.nl 2861 [2001:888:2000:d::a6]:59071 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76903 On 23 August 2014 18:47, Seymore4Head wrote: > Anyone care to suggest what method to use to fix the decimal format? It sounds like you want a primer on floating point. The documentation of the decimal module is actually a good read, although I don't doubt there are even better resources somewhere: https://docs.python.org/3/library/decimal.html Note that you probably also want to use the decimal module, seeing as it's good at storing decimals. Finally, look at "moneyfmt" in the decimal docs: https://docs.python.org/3/library/decimal.html#recipes