
The latter terms are used primarily in formal contexts.īefore the SI, there were older forms of the metric system that used different base units. For example, the CGS system used the centimetre, gram, and second, and included now-obsolete units like the erg and dyne.

So, in the early days, the term “metric system” was ambiguous, leading to the term “modern metric system” to refer specifically to the SI.īut it’s been more than 50 years since the SI was defined, so for all practical purposes, today “the metric system” is synonymous with the SI. Note that “metric” (in the context of the SI) is an adjective, not a noun: metric system, metric units, metric legislation, metric conversion, metric ton, etc. People sometimes use “metric” or “metrics” as slang for “the metric system”, but this is not technically correct. Refer to the question What’s a metric? (below) for other meanings of the word. To read the SI standard, get a copy of the SI Brochure from the International Bureau of Weights and Measures (BIPM). However, for computations on money, I second the recommendation, already given in other answers, to stick with what the decimal module offers, instead of float numbers.It’s available at no charge in English or French.

If two multiples are equally close, rounding is done toward the Or, as the docs put it (exemplifying with the single-argument form of round, which rounds to the closest integer): I imagine you first had the typo occur in transcription, and then mentally computed the desired rounding from the falsified-by-typo 2.607 rather than the actual original result - is that what happened? It sure managed to confuse me for a while!-)Īnyway, to round a float to two decimal digits, simplest approach is the built-in function round with a second argument of 2: > round(2.067, 2)įor numbers exactly equidistant between two possibilities, it rounds-to-even: > round(2.605, 2) which might be a typo, just swapping two digits, except that you then ask "How can I set that to $2.61 instead?" so it really seems you truly mean 2.607 (which might be rounded to 2.61 in various ways) and definitely not the arithmetically correct result, 2.067 (which at best might be rounded to 2.07. as expected - yet, you say it instead "returns a display of $ 2.607". mealPrice = input('Enter the meal subtotal: $')

but then I confirmed it hasn't, yet, by using, as I imagine you are, Python 3.1, and copying and pasting.: > def input_meal(): I'm astonished by the second number you mention (and confirm by your requested rounding) - at first I thought my instinct for mental arithmetic was starting to fail me (I am getting older, after all, so that might be going the same way as my once-sharp memory!-).
