Template:Ps2configrev: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
m (Working with decimal ranges)
m (Is not the most elegant way to do it but it works)
Line 1: Line 1:
{{#ifexpr:{{{1|0}}}>=0 and {{{1|0}}}<=999| One thousand | {{#ifexpr:{{{1|0}}}>=1000 and {{{1|0}}}<=1999| Two thousands | value is out of range }} }}
{{#ifexpr:{{{1|0}}}>=0 and {{{1|0}}}<=999
 
  |<!--then-->One thousand
 
  |<!--else-->{{#ifexpr:{{{1|0}}}>=1000 and {{{1|0}}}<=1999
<noinclude>
    |<!--then-->Two thousands
    |<!--else-->{{#ifexpr:{{{1|0}}}>=2000 and {{{1|0}}}<=2999
      |<!--then-->Three thousands
      |<!--else-->{{#ifexpr:{{{1|0}}}>=3000 and {{{1|0}}}<=3999
        |<!--then-->Four thousands
        |<!--else-->The value is out of range
      }}
    }}
  }}
}}<noinclude>


<!-- failed first attempt
<!-- failed first attempt
Line 32: Line 41:
<br>
<br>
== Tests ==
== Tests ==
{{ps2configrev|999}}
{{ps2configrev|0}}, {{ps2configrev|745}}, {{ps2configrev|999}}<br>
 
{{ps2configrev|1000}}, {{ps2configrev|1745}}, {{ps2configrev|1999}}<br>
{{ps2configrev|1999}}
{{ps2configrev|2000}}, {{ps2configrev|2734}}, {{ps2configrev|2999}}<br>
 
{{ps2configrev|3000}}, {{ps2configrev|3699}}, {{ps2configrev|3999}}<br>
{{ps2configrev|99999999}}
{{ps2configrev|99999999}}



Revision as of 10:58, 27 September 2021

One thousand



Tests

One thousand, One thousand, One thousand
Two thousands, Two thousands, Two thousands
Three thousands, Three thousands, Three thousands
Four thousands, Four thousands, Four thousands
The value is out of range


Notes

It could be handy to do the conversion in this sequence: 1) hexLE to hexBE, 2) hexBE to dec, 3) Math expression to compare the value in ranges
I been trying to do step 2 using this template https://en.wikipedia.org/wiki/Template:Hex2dec Is dependant of the module https://en.wikipedia.org/wiki/Module:BaseConvert Actually we dont need the template because we can call the module BaseConvert directly in a single line this way: {{#invoke:BaseConvert|16to10|FFFF}}
We already have a template named https://www.psdevwiki.com/ps3/Template:Hex2dec ... but is not doing the conversion
We already have the module BaseConvert installed in this wiki https://www.psdevwiki.com/ps3/Special:Version but doesnt seems to work, it looks we cant "#invoke" it. Im wondering if is because we need to copy also the script into https://www.psdevwiki.com/ps3/Module:BaseConvert (the page doesnt exists)
So... by now i dont know how to do steps 1 and 2 of the conversion process. And the math expressions (required for step 3) only works with decimals... so the only solution by now is to pass the decimal value to this template