14

This is related to a question I just posted on standardizing units. As I presuppose in that question, most of us are familiar with one set of units, and the other reads like gibberish. The simplest example is temperature, but a more complicated one is some countries measure flour by weight, and others by volume. Now, I can go look up how many cups of flour 400g is, and I can ask Google what 180°C is in °F, but this is both annoying and an extra step.

Granted, this is not supposed to be a recipe site, but that doesn't mean people aren't going to talk about temperatures, or ingredients, nor are people going to refrain from posting recipes (or parts thereof). This is certainly evidenced at least by this question on temperatures.

Relying on people to manually edit these and include both is a solution which I feel doesn't scale. So, how do we feel about some kind of inline (automatic) conversion? This could pop up as a tooltip, be automatically included in the text, or have some other way to quickly get at this information.

6

Personally, I hate the attempts I've seen on automatic conversion in a public space. You either end up with statements like:

  • Stir in 4-13/16 Tbsp butter
  • Pour mixture into a 4.1892 quart baking dish
  • Heat in a 394°F oven for 30 minutes.

Or a horrible rounding algorithm.

This is the perfect application for the wiki aspect of these sites. If the author doesn't take it upon themselves to provide conversions,

cook to 212F (100C)

then someone should edit the post to improve the answer. It's nice to say "standardize it" but it would be even more helpful to make the answer better for everyone.

  • 3
    How about instead of converting inline, you put them in a tooltip, like what happens when you hover over a "friendly" formatted timestamp? – Aaronut Jul 13 '10 at 17:42
  • @Aaronaught: I amended my answer for what I think is better than a tooltip. Wiki. – Robert Cartaino Jul 13 '10 at 17:45
  • 2
    The fast and easy solution is to force people and countries using ancient and outdated units (cups, Fahrenheit, ounces and so on) to use units of the International System: weight (in grams) for flour, volume (liter) for liquids and Celsius for temperature. – Wizard79 Jul 20 '10 at 10:06
  • 2
    @Lorenzo, fast and easy for you perhaps, but a major inconvenience to someone who has only ever used "ancient and outdated units" and isn't au fait with new fangled units. If we're too prescriptive, people simply won't contribute. +1 to @Robert Cartaino for reminding us all that everyone can edit.. – Rob Jul 26 '10 at 12:13
  • @Rob, actually, not everyone can edit - you need to have a certain amount of reputation. – Marti Oct 7 '10 at 19:24
  • @Marti Now, everyone can edit, and wait for a moderator approves it for it being applied. If you do edit, and gets your edit accepted by a moderator, you actually gets 2 rep points for your effort! – awe Mar 5 '12 at 10:52
3

How about using a markdown tag to indicate the "units" text. Then it could be expanded inline, either to units specified in a user's preference setting, or to a common set of translations?

I'm thinking of a questions or answer containing something like:

Stir in [units]200 g[/units] of butter

which could be expanded to:

Stir in [200 g] [7 oz] of butter

The only trick bit here would be that cups are a different amount depending on what's being measured (1 cup of flour != 1 cup of sugar), and sticks only refers to butter.

  • 3
    Butter comes in sticks in the US. I have no idea how much butter is in a stick :) – Binary Worrier Jul 13 '10 at 15:32
  • 1
    @Binary: 1/4 pound, or 1/2 cup usually, and a block of butter is usually 1 pound / 2 cups. – Eclipse Jul 13 '10 at 17:05
  • Most recipes have butter (and other ingredients) measured in volume, not weight in the US. – Lee Jul 15 '10 at 14:09
2

If this does become supported, please don't forget that conversion also depends on HOW you measure it. Converting flour from weight to volume is no trivial task, because there's so many different methods to measure it (scoop-and-level, spoon into measure, pack it in, etc.). The only way this should be supported is between the same types of units.

2

Since I know this will not get implemented in the near future, I decided to try my hand at a user script.

Warning: This is not production-quality code. It's not even beta. It's not even alpha. It's something I threw together in maybe 2 or 3 hours of combined coding and testing.

Disclaimers aside, it does seem to work on most of the Imperial measurements posted on this site. So don't be afraid to give it a try and report anything that's seriously broken. And if it ends up breaking more than it fixes, just uninstall it.

What this script does:

  • Searches for U.S. Imperial measurements posted in answers.
  • Wraps them in a help-style link and adds a tooltip with the converted unit.
  • Whole (1 tsp), fractional (1/2 tsp), and decimal (1.5 qt) measurements.
  • Units: ° F, teaspoons, tablespoons, ounces, fluid ounces, cups, quarts, pounds.
  • Tries to ignore units inside URLs, but this hasn't been tested extensively.

What this script doesn't do (yet):

  • Search in comments. (Concerned about performance and deferred loading.)
  • Compound fractions (e.g. "1 1/2 cups"). It only sees the fraction.
  • Temperature ranges where the unit is only written once (e.g. "350-450° F").
  • Try to guess if "oz" really means dry ounces or fluid ounces. Not touching that one with a fifty-foot pole. Americans, don't be lazy, write your units out properly.
  • Any unit conversions other than the one specified above.
  • Any kind of interactive features.
  • Know the difference between "C" for Cups and "C" for Celsius. However, it uses some number thresholds to make an educated guess, since these two are rarely in the same range.
  • Convert units as you type, or in post previews. This is purely for reading posts, not writing.
  • Convert units the other way (Metric --> Imperial) - it really only makes sense to do one at a time, but when this is a little more stable I can just reverse most of the formulas and put up an alternate script for U.S. viewers.

I'll try to find some time every now and then to work on improvements. No promises though.


And here's my little sandbox/demo/proof-of concept (try viewing this with the script installed):

  • 1/2 C chicken or vegetable stock
  • 1 fl oz Brandy
  • 1 (14 oz) can tomato sauce
  • 1 fluid ounce of vodka
  • (Optional) 8 fl. oz. Dry White Wine
  • 3 ounces parmesan cheese
  • Add 2 Tbsp sugar
  • Add 1.5 tbs. cream
  • ...or .5 tbs. butter
  • Stir in 1/4 tsp. salt
  • 1/2 tsps black pepper
  • 1/2 teaspoon crushed red pepper
  • 3 tablespoons of water
  • 350 F
  • Makes 4 quarts, or 3 qts. if no wine is used
  • 1 flat cookie sheet
  • Bake at 350° F
  • Bake at 425F for 30 minutes
  • ...until the internal temperature reaches 165 degrees F or the juices run clear
  • This 1 tbsp in tsp link should not be broken
  • P.S. It's not that I don't agree with Robert's answer of "that's what wiki/editing is for", it's just that it doesn't usually happen that way. Especially with new users coming in all the time, it's just not reasonable to expect that every single newbie post is going to be carefully reviewed and edited this way. – Aaronut Mar 7 '12 at 6:06
1

I think the best would be to add a converter utility at the right side. It is easy enough to find conversion sites on the internet, but it would be much more convenient to have it incorporated as a little "units" widget in the sidebar.

  • I doubt that this is going to get implemented by the developers, but it might be possible to do with a bookmarklet, if one of our community members wants to give it a go. – Aaronut Mar 6 '12 at 4:03
  • I'm not sure I have comletely grasped the "bookmarklet" consept. Do you mean something like this? – awe Mar 6 '12 at 10:01
  • No... that's just a question? See bookmarklet, it's basically just a piece of javascript you run in your own browser. – Aaronut Mar 6 '12 at 14:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .