Template talk:MPGe
From Wikipedia, the free encyclopedia
Contents |
[edit] Which gallon?
"DeFacto (Talk | contribs) (598 bytes) (MoS states type of gallon needs to be clearly stated) " I felt that MPGe implies a U.S. gallon and the link is in the metric. It already takes a lot of space to put both the MPGe and Si units. I'm not opposed to changing it (in all templates), but what's the justification? Ephdot (talk) 16:32, 21 March 2008 (UTC)
- The Wikipedia Manual of Style (MoS) states that when using a unit name that is shared by different units (as 'gallon' is), there is a need to be specific. It specifically states: "Use US or imperial gallon rather than just gallon." Take a look at the mpg templates, Template:Mpg and Template:Mpg (Imperial), they show all three (mpg U.S., l/100km, and mpg imperial). -- de Facto (talk). 16:53, 21 March 2008 (UTC)
OK, I adjusted the MPGe page to explicitly state U.S. gallons do you think this isn't enough? Can we make the thing smaller somehow like usMPGe or something? It's only used in the Fuel efficiency in transportation page so far, a very narrow context. Is it confusing? Some kind of SI unit would be better - but I haven't found such a thing yet. Ephdot (talk) 17:05, 21 March 2008 (UTC)
- I think that the Fuel efficiency in transportation article already has a confusion of U.S. gallons, and imperial gallons, given that there is U.S. and UK content, so anything that helps to clarify the units would be beneficial. The template is a good place to put it, because it is then displayed automatically whenever that template is used. -- de Facto (talk). 17:37, 21 March 2008 (UTC)
Making everything SI would be best. Maybe I'll reverse the order X L/100km (Y MPGe US)? Ephdot (talk) 18:07, 21 March 2008 (UTC)
-
- I tend to agree with Ephdot's initial reasoning. The unit in question is MPGe which is defined in terms of the US gallon (as I read it). Just as when one talks of the barrel of oil equivalent one needn't worry about whether we're talking imperial barrels, US beer barrels, US dry barrels, Somali water barrel or monkey barrels, it's 5.8 million BTU and that's that. I suggest the subscript "US" be removed from the "MPGe"—the link should be sufficient (after the article's had a bit of a tidy-up) and the link will generally also be necessary. Jɪmp 02:07, 26 March 2008 (UTC)
[edit] Precision
The L/100 km number gets smaller as the mpg gets larger. It needs to keep 2 digits or something? Should depend on? Ephdot (talk) 03:26, 27 March 2008 (UTC)
- How about rounding to a given number of significant figures which could either be entered by the user or default to some given number (two should do)? Jɪmp 04:09, 27 March 2008 (UTC)
- Yes, how? Ephdot (talk) 04:29, 27 March 2008 (UTC)
- I could not find a log or ln function. "om" should work. Ephdot (talk) 13:25, 27 March 2008 (UTC)
{{formatnum: {{#expr:235.214584 / (({{{1}}}) * 1) round {{om|{{{1}}}}}+{{{2|1}}} }} }} L/100 {{#switch:{{{p|}}}|on=p·|}}km ({{formatnum: {{#expr:({{{1|1}}}) * 1 round ({{{2|1}}}-1) }} }} {{#switch:{{{p|}}}|on=p·|}}{{#switch:{{{lk|}}}|on=[[MPGe]]|=MPGe}}<sub>US</sub>)
Template:Om
Expression error: Unrecognised punctuation character "[" L/100 km (145 MPGeUS)
[edit] Suggestions
[edit] Merge
We have eight templates in Category:MPGe conversion templates. They could all be merged here. A single template would be easier to use, maintain and improve.
Take {{MPGe L/100 km}} and {{MPGe mpgimp}}.
"MPGe L/100 km" and "MPGe mpgimp" are meant to be nested into other MPGe templates for convenient conversion to mpg-US which MPGe uses as a basis for conversion to equivalents.
How exactly this is meant to be done might not be clear to a user who doesn't have time to chase down an example in the wild or to pick through the template code (supposing they can read it). Of course, this could be fixed by giving explicite examples in the documentation but do we not have a better approach? Here are a couple such examples.
- {{MPGe|{{MPGe L/100 km|10}}}} gives 10 L/100 km (24 MPGeUS)
- {{MPGe|{{MPGe mpgimp|12}}}} gives 23.5 L/100 km (10 MPGeUS)
Is this terrificly convienent? Might it not be easier to input the "L/100 km
" or "mpgimp
" as a parameter? Something like {{MPGe|10|L/100 km}}}} for example. Moreover, it could be made such that "mpgus
" would also have to be input explicitely. This, of course, would make the template somewhat less convenient as there'd be more to input but there'd be a significant advantage. The code as appears in the article would be a lot easier for the user to figure out since mpg (US), mpg (imp) and L/100 km would all be given equal footing. Instead of
- {{MPGe|10}} for miles per US gallon
- {{MPGe|{{MPGe mpgimp|12}}}} for miles per imperial gallon
- {{MPGe|{{MPGe L/100 km|24}}}} for litres per 100 km
we'd have
- {{MPGe|10|mpgus}} for miles per US gallon
- {{MPGe|12|mpgimp}} for miles per imperial gallon
- {{MPGe|24|L/100 km}} for litres per 100 km
This brings us to {{MPGe kWh}}, {{MPGe vkWh}} and {{MPGe BTU}}. How is the user to know that these are kWh and BTU per mile? Unless the user goes to the template pages they won't know. Remember we've got eight pages to digest. Instead why not enter the input units just as I suggested above?
- {{MPGe|15|BTU/mi}} for BTU per mile
- {{MPGe|18|kWh/mi}} for kilowatt hours per mile
This will also allow for other units such as
- {{MPGe|15|kWh/km}} for kilowatt hours per kilometre
- {{MPGe|18|kJ/km}} for kilojoules per kilometre
Of course, there are fundamental differences between {{MPGe kWh}}, {{MPGe vkWh}} and {{MPGe BTU}}.
As far as I can tell these are
- a difference in output units and
- a difference in what the input unit is assumed to be measuring.
How do we deal with this?
- Output units could be explicitely determined by a parameter, the default would be "L/100 km (MPGe)".
- Let's not make any such assumption. I think I see where this distinction is coming from with this quote from MPGe
Attempts are often made to equate the heat that electric energy can produce with the heat needed to produce that electricity. It is not a two way conversion and the fact that the units suggest that it is, is an unfortunate point of confusion. Many try to avoid this confusion by referring to heat in units of BTU and electric energy in units of kilowatt hours.
Having grown up with the metric system, though, I would never dream of measuring anything in BTU. To me that sounds like deciding that beer is measured in pints, whisky in fluid ounces and everything else in litres or millilitres and so if you mention pints, it must be beer but if you mention millilitres it cannot be whisky.
The BTU is a unit of energy. The kWh is a unit of energy. For the sake of the user who is not familiar with what "many" do to aviod confusion let's make it quite explicite in the code what is being assumed. If the conversion is with a 34% efficient source of electricity, have this entered as a parameter. If your conversion factor wants to take the form of kWh/US gal use another parameter.
This brings us to the two templates remaining, {{MPGe Diesel}} and {{MPGe JetK}}. These differ from {{MPGe}} with respect only to their efficency factors. These parmeters could take such forms as fuel=diesel
, kWh/usgal=11
or, since they'd have similar functions, they could be made to look similar, e.g. efficiency_fuel=diesel
, efficiency_kWh/usgal=11
.
With the whole category merged into one template, it would be simple to introduce improvements like significant figure rounding (which is probably the best kind of rounding you could use when you're dealing with conversions which take the inverse of some measurement) and displaying output as single numbers in a cell of a table. Jɪmp 05:55, 27 March 2008 (UTC)
- It should be something like (MPGe|10|L/100km|BTU) - it also needs the conversion type to make it all one template. I wrote about this somewhere else, I just don't have the knowledge and time to learn to do it right now. Ephdot (talk) 12:13, 27 March 2008 (UTC)
- Would {{MPGe|10|BTU/mi|L/100km}} count as being something like {{MPGe|10|L/100km|BTU}}? That is, put the numerical value first, then the input units and the output units after that. Also specify that it's BTU ''per mile''. Conversoin type could be specified by another parameter, e.g. {{MPGe|10|mpgimp|L/100 km|fuel=diesel}}. Jɪmp 16:06, 27 March 2008 (UTC)
- That's exactly what I meant but chose a poor example. Actually, it goes - mi/BTU, mi/kWh, mpgus or mi/galus, mpgimp or mi/gal imp...
- I suppose we could throw in all the L/100 km and BTU/mi, BTU/km etc...
- Maybe your "fuel=BTU" is best? I don't know anymore, it's all looking wrong to me.
- I'm not sure about the MPGe metric either, I assumed it was a known metric since it was on wikipedia. The more I look into it, the less it looks like a real measure.
- But SOMETHING or many things must be out there to compare one vehicle's efficiency (minus the power plant) compared to another.
- This keeps looking like {{OR}}
- , horrors... Ephdot (talk) 16:45, 27 March 2008 (UTC)
- Would {{MPGe|10|BTU/mi|L/100km}} count as being something like {{MPGe|10|L/100km|BTU}}? That is, put the numerical value first, then the input units and the output units after that. Also specify that it's BTU ''per mile''. Conversoin type could be specified by another parameter, e.g. {{MPGe|10|mpgimp|L/100 km|fuel=diesel}}. Jɪmp 16:06, 27 March 2008 (UTC)
-
-
-
- ... or what can be salvaged? This whole conversion between energy units and volume units based on ... what exactly was it ... fuel, energy source ... does seem a little fuzzy. However, mi/BTU (or BTU/mi) to km/kWh (kWh/km) is straightforward ... as long as we're not assuming one unit to measure one thing and the other something else and then go factoring in some account of energy loss per unit distance. A BTU is ~1055 J, a kWh is 3600 J, a mile is ~1.6 km so a mi/BTU is ~1.6 × 3.6 ÷ 1.055 km/kWh and that's that. Jɪmp 17:51, 27 March 2008 (UTC)
- Is MPGe in the list? I didn't see it there.
- A way to simplify the whole thing - and what I was doing all along, but didn't name right -
- {{MPGe|10|mi/X|BTU}} or {{MPGe|10|X/100 km|BTU}}
- Ephdot (talk) 18:15, 27 March 2008 (UTC)
- kWh can't simply be converted to MPGe (joule to joule). Don't do it at all. the MPGe kWh template doesn't do it now either. It just "converts" to kWh/100 km. Ephdot (talk) 18:19, 27 March 2008 (UTC)
- ... or what can be salvaged? This whole conversion between energy units and volume units based on ... what exactly was it ... fuel, energy source ... does seem a little fuzzy. However, mi/BTU (or BTU/mi) to km/kWh (kWh/km) is straightforward ... as long as we're not assuming one unit to measure one thing and the other something else and then go factoring in some account of energy loss per unit distance. A BTU is ~1055 J, a kWh is 3600 J, a mile is ~1.6 km so a mi/BTU is ~1.6 × 3.6 ÷ 1.055 km/kWh and that's that. Jɪmp 17:51, 27 March 2008 (UTC)
-
-
-
-
-
-
-
- No, sorry, being unclear again. I didn't mean that it is on the list rather I meant that if it's no longer making any sense & is looking like OR, then should we put it on the list? What would the X be? Do you mean mi/kWh to MPGe ... no, no simple conversion between energy and volume. Jɪmp 18:41, 27 March 2008 (UTC)
- How about {{MPGe|10|mi|BTU}} or {{MPGe|10|BTU|100km}} let the template sort it out. Is that what you had originally? (sort of?)
- You have to do string manipulation on top if you just have one parameter, no string manipulation with two, just symbols. Or you list out all the possibilities. That could work too. Ephdot (talk) 19:02, 27 March 2008 (UTC)
- That could work, {{MPGe|10|mi|BTU}} meaning 10 mi/BTU to convert to kWh/100 km (by default or something else which could be entered as further parameters, e.g. {{MPGe|10|mi|BTU|km|kJ}} for km/kJ). That might make the template a little simpler to write ... maybe ... but would it be as clear to the user what is going on? Do excuse me though, I've got to sleep, see ya in a about 6 hours. Jɪmp 19:20, 27 March 2008 (UTC)
- But what I'd had in mind was listing out all the possibilities. How many would there be?
- mi/BTU
- BTU/mi
- mi/Wh
- Wh/mi
- km/Wh
- Wh/km
- kWh/100 km
- kJ/km
- km/kJ
- L/100 km
- mpgimp
- mpgus
- But what I'd had in mind was listing out all the possibilities. How many would there be?
- That could work, {{MPGe|10|mi|BTU}} meaning 10 mi/BTU to convert to kWh/100 km (by default or something else which could be entered as further parameters, e.g. {{MPGe|10|mi|BTU|km|kJ}} for km/kJ). That might make the template a little simpler to write ... maybe ... but would it be as clear to the user what is going on? Do excuse me though, I've got to sleep, see ya in a about 6 hours. Jɪmp 19:20, 27 March 2008 (UTC)
- No, sorry, being unclear again. I didn't mean that it is on the list rather I meant that if it's no longer making any sense & is looking like OR, then should we put it on the list? What would the X be? Do you mean mi/kWh to MPGe ... no, no simple conversion between energy and volume. Jɪmp 18:41, 27 March 2008 (UTC)
-
-
-
-
-
-
-
-
-
-
-
-
- There's a dozen, it's not all possibilities but I think it's covered about everything we'd be needing. How would this compare to the approach where these are entered seperately?
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- BTU
- Wh
- kWh
- kJ
- km
- 100 km
- mi
- L
- impgal
- usgal
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- This seems to be only slightly fewer ... assuming, of course, that I had covered about everything we'd be needing in the previous list. To me it doesn't quite seem worth the bother and risk of causing user confusion. I think I'd go for listing out all the (useful) possibilities after all.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Back, then, to the original idea. I'm suggesting
{{{1}}}
(first unnamed parameter) as the numerical input (required){{{2}}}
(second unnamed parameter) as the input unit (required){{{3}}}
(third unnamed parameter) as the output unit(s) (optional – default dependant on input unit){{{sigfig}}}
(named parameter) as the number of significant figures to round to (optional – default to 2){{{disp}}}
a parameter to adjust how the output is displayed (optional – default to having the main output unit displayed as normal text with secondary output units in brackets, i.e., as the template currently works)disp=table
would display the values as numbers in cells of a tabledisp=in
would display the input as well- etc.
{{{colour}}}
the colour of the table cell(s) (optional – defaulting to white, ingored when not in table mode)- plus a number of parameters to determine the volume–energy conversion factor (optional – defaulting to 115,000 BTU per US gallon) these might take the following forms
{{{fuel}}}
, e.g. setfuel=diesel
for 115,000 × 0.88 BTU per US gallon{{{kWh/usgal}}}
e.g. setkWh/usgal=11
for 11 kWh per US gallon- etc.
{{{p}}}
adds the "p·" for passenger.
- What do you think? Jɪmp 03:25, 28 March 2008 (UTC)
- Back, then, to the original idea. I'm suggesting
-
-
-
-
-
-
-
or |
Should we forget all about this energy to volume-of-given-fuel conversion and just stick to what we find in the sources, rework and rename the template(s) to convert the likes of mi/BTU, mi/kWh, km/kWh, etc. to SI MJ/km, km/MJ? Jɪmp 04:54, 28 March 2008 (UTC)
[edit] What to do?
Okay ... this whole mess is beginning to look a little clearer. As I argue at Talk:MPGe#MPGe? the MPGe is the same as the mpgge. The mpgge is mile per GGE. The GGE corresponds to a certain amount of energy, 115,000 BTU. Though it may be defined as "the amount of alternative fuel it takes to equal the energy content of one liquid gallon of gasoline" a vehicle which runs at x mpgge is running at x⁄115,000 mi/BTU. We can treat mpgge as a unit of distance per energy. The mpgge and the mpg are quite different measures. We cannot convert to kilometres per litre, litres per kilometre, or litres per 100 km. We could convert to litres of petrol equivalent per 100 km but should not use "l/100 km". However, it would appear that such a unit is not widely used. Indeed, there would seem to be a strong preference in favour of the standard SI MJ/km. The mpgge may be popular in the US as a means of energy-efficiency comparision that doesn't mean that the similarly defined litre of petrol equivalent per 100 km will even make sense to the rest of us. To drive the point home a little further, try tracking down an abbreviation—note that "l/100 km" doesn't count since it actually means something else, litres per 100 km (no mention of any equivalent), i.e. a whole different unit, and for this reason the abbreviation should not be used. Talk of a "4.7 L/100 km ... electric vehicle", baffling, what the change in volume of the atomic electron clouds in the car battery per 100 km? So, what am I saying? First of all scrap the quasimetric misabbreviated litres of petrol equivalent per 100 km in favour of something that is well used and recognised, something SI (Joules & metres). Jɪmp 08:28, 28 March 2008 (UTC)
- Scientists will use the appropriate measures and can make the conversions on their own. The point of MPGe is to convert to something familiar(same with L/100 km). It might be better to have a tag like (Diesel-equivalent). Also, converting directly to MJ makes it too tempting to (wrongly) convert electricity numbers to heat numbers. This cannot be done directly in reality and depends on the conversion machine. These discussions should be on the MPGe page, no? Ephdot (talk) 11:51, 28 March 2008 (UTC)
- Scientists? I'm all for converting to something familiar. Miles per US gallon of gasoline equivalent may be familiar to Americans. Whether litres of petrol equivalent per hundred kilometres is familiar to the rest of us is another question. Is it even a metric unit? Are we not defining our litre of petrol equivalent as the appropriate fraction of the GGE? Is this not a unit of our own invention? What is familiar worldwide is the standard SI unit, the MJ. Electricity numbers, heat numbers ... it's all energy. Using different units for different forms of energy to me is a recipe for introducing more confusion rather than clearing it up. If you use the same units for heat as for work, then it's made more clear that the difference was due to a physical loss of energy by the heat engine. But, yeah, this is not really the talk page. Talk:MPGe ... perhaps this calls for some thing even broader, like WT:MOSNUM. Jɪmp 06:27, 30 March 2008 (UTC)
- MJ/km is OK, but conversion from L/100 km to MJ/km isn't. mpgge/MPGe do exist as measures and can be explained here. The litre (L) is an accepted measure. http://physics.nist.gov/Pubs/SP811/sec05.html#5.1.4 So, I think we can keep the mpgge measure for heat based engines and not make conversion to/from electricity or power, at least not without explicitly stating assumptions if used at all. Ephdot (talk) 12:34, 30 March 2008 (UTC)
- The litre is acceptable but it's the litre of petrol equivalent I'm questioning. The joule is the SI unit of energy be it chemical, mechanical, kinetic, heat, potential, electric, etc. As I read it, the mpgge relates to distance travelled per unit of fuel energy so conversion to MJ/km makes perfect sense. We certainly must note that these megajoules relate to the energy of the fuel. Jɪmp 01:12, 31 March 2008 (UTC)
- MJ/km is OK, but conversion from L/100 km to MJ/km isn't. mpgge/MPGe do exist as measures and can be explained here. The litre (L) is an accepted measure. http://physics.nist.gov/Pubs/SP811/sec05.html#5.1.4 So, I think we can keep the mpgge measure for heat based engines and not make conversion to/from electricity or power, at least not without explicitly stating assumptions if used at all. Ephdot (talk) 12:34, 30 March 2008 (UTC)
- Scientists? I'm all for converting to something familiar. Miles per US gallon of gasoline equivalent may be familiar to Americans. Whether litres of petrol equivalent per hundred kilometres is familiar to the rest of us is another question. Is it even a metric unit? Are we not defining our litre of petrol equivalent as the appropriate fraction of the GGE? Is this not a unit of our own invention? What is familiar worldwide is the standard SI unit, the MJ. Electricity numbers, heat numbers ... it's all energy. Using different units for different forms of energy to me is a recipe for introducing more confusion rather than clearing it up. If you use the same units for heat as for work, then it's made more clear that the difference was due to a physical loss of energy by the heat engine. But, yeah, this is not really the talk page. Talk:MPGe ... perhaps this calls for some thing even broader, like WT:MOSNUM. Jɪmp 06:27, 30 March 2008 (UTC)
[edit] Table mode
Displaying output as single numbers in a cell of a table is one of the improvements that could be made. Here's how {{convert}} does it.
{|class="wikitable sortable" |- ! Vehicle ! km/l ! mpg (US) |- |my car |{{convert|12|km/l|mpgus|disp=table}} |- |your car |{{convert|20|km/l|mpgus|disp=table}} |- |his car |{{convert|24|km/l|mpgus|disp=table}} |- |her car |{{convert|10|km/l|mpgus|disp=table}} |}
Vehicle | km/l | mpg (US) |
---|---|---|
my car | 12 | 28 |
your car | 20 | 47 |
his car | 24 | 56 |
her car | 10 | 24 |
Yeah, no, that's not how {{convert}} does it. That's just the code you type on the page & what it produces. How it's done would take a bit more explaining but I'm just mentioning that it's doable. Shall we not add this feature?
Getting them to look together when we've got more than one pair of columns is another challenge. You can do this with {{convert}} by using alternating coloured and white columns as you can see here here and here. We could take that a step further here and have both columns the same colour, then the next pair another colour—not so great for the colour-blind but what can you do? Jɪmp 07:17, 27 March 2008 (UTC)
Vehicle | km/l | mpg (US) | km/l | mpg (US) | km/l | mpg (US) |
---|---|---|---|---|---|---|
my car | 12 | 28 | 12 | 28 | 12 | 28 |
your car | 20 | 47 | 20 | 47 | 20 | 47 |
his car | 24 | 56 | 24 | 56 | 24 | 56 |
her car | 10 | 24 | 10 | 24 | 10 | 24 |
- This is what it would look like. Hard to figure out what's what. Ephdot (talk) 13:32, 27 March 2008 (UTC)
-
- True but what I'd had in mind with the colouring-in would look more like this.
Vehicle | km/100 km in petrol mode |
mpg (US) in petrol mode |
km/100 km in electric mode |
mpg (US) in electric mode |
km/100 km in Flintstone mode |
mpg (US) in Flintstone mode |
---|---|---|---|---|---|---|
my car | 12 | 20 | 20 | 12 | 80 | 3 |
your car | 20 | 12 | 12 | 20 | 120 | 2 |
his car | 24 | 10 | 48 | 5 | 240 | 1 |
her car | 10 | 24 | 5 | 48 | 2 | 120 |
[edit] table sort fix.
It seems the sort function are in this file: http://en.wikipedia.org/skins-1.5/common/wikibits.js
The part that is missing should be in here:
<code><nowiki> function ts_resortTable(lnk) { // get the span var span = lnk.getElementsByTagName('span')[0]; var td = lnk.parentNode; var tr = td.parentNode; var column = td.cellIndex; var table = tr.parentNode; while (table && !(table.tagName && table.tagName.toLowerCase() == 'table')) table = table.parentNode; if (!table) return; // Work out a type for the column if (table.rows.length <= 1) return; // Skip the first row if that's where the headings are var rowStart = (table.tHead && table.tHead.rows.length > 0 ? 0 : 1); var itm = ""; for (var i = rowStart; i < table.rows.length; i++) { if (table.rows[i].cells.length > column) { itm = ts_getInnerText(table.rows[i].cells[column]); itm = itm.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, ""); if (itm != "") break; } } sortfn = ts_sort_caseinsensitive; if (itm.match(/^\d\d[\/. -][a-zA-Z]{3}[\/. -]\d\d\d\d$/)) sortfn = ts_sort_date; if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d\d\d$/)) sortfn = ts_sort_date; if (itm.match(/^\d\d[\/.-]\d\d[\/.-]\d\d$/)) sortfn = ts_sort_date; if (itm.match(/^[\u00a3$\u20ac]/)) // pound dollar euro sortfn = ts_sort_currency; if (itm.match(/^[\d.,]+\%?$/)) sortfn = ts_sort_numeric; // INSERT HERE var reverse = (span.getAttribute("sortdir") == 'down'); var newRows = new Array(); for (var j = rowStart; j < table.rows.length; j++) { var row = table.rows[j]; var keyText = ts_getInnerText(row.cells[column]); var oldIndex = (reverse ? -j : j); newRows[newRows.length] = new Array(row, keyText, oldIndex); } newRows.sort(sortfn); var arrowHTML; if (reverse) { arrowHTML = '<img src="'+ ts_image_path + ts_image_down + '" alt="↓"/>'; newRows.reverse(); span.setAttribute('sortdir','up'); } else { arrowHTML = '<img src="'+ ts_image_path + ts_image_up + '" alt="↑"/>'; span.setAttribute('sortdir','down'); } // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones // don't do sortbottom rows for (var i = 0; i < newRows.length; i++) { if ((" "+newRows[i][0].className+" ").indexOf(" sortbottom ") == -1) table.tBodies[0].appendChild(newRows[i][0]); } // do sortbottom rows only for (var i = 0; i < newRows.length; i++) { if ((" "+newRows[i][0].className+" ").indexOf(" sortbottom ") != -1) table.tBodies[0].appendChild(newRows[i][0]); } // Delete any other arrows there may be showing var spans = getElementsByClassName(tr, "span", "sortarrow"); for (var i = 0; i < spans.length; i++) { spans[i].innerHTML = '<img src="'+ ts_image_path + ts_image_none + '" alt="↓"/>'; } span.innerHTML = arrowHTML; ts_alternate(table); } </nowiki></code> --------------- A line like: if (itm.match(/^.*sm=n.*$/)) sortfn = ts_sort_numeric;
Needs to be inserted. Ephdot (talk) 13:48, 27 March 2008 (UTC) Tested it and it works. Don't know if it breaks anything else. How do I fix it? I think the other "sm=" switches need to be included too. Ephdot (talk) 14:06, 27 March 2008 (UTC)