ଛାଞ୍ଚ ଆଲୋଚନା:0expr

message: {{}} adds a leading zero to non-negative results less than 10 for date calculations.
=== Usage ===
replies: text: {{|expression}} - returns result as is, or 0result for 0 ≤ result < 10.

text: {{|1=expression}} - ditto for expressions containing equal signs.
;Updates:

text: #The code was simplified for better support of optional substitution (= no more parameter defaults), hence empty expressions are not more supported.

text: #Decimal fractions are now kept as is (1.25 results in 01.25), this can be useful for the seconds in timestamps hhmmss.nnn, see ISO 8601.
=== Example ===
Code                               	Result
{{|-1}}             	
{{|123/100}}        	
{{|1+9}}            	
{{|not 10}}         	
{{|1=(7<=8)*9}}  	
{{|(7<=8)*9|2+3}}	
The last example shows that expressions containing "=", "<=", or ">=" won't work directly.
=== See also ===
* 
* 
*  (similar)
*  (1= trick)
thread_title: Documentation

message: :{{|expression}} - returns result as is, or 0result for 0 ≤ result < 10.
replies: text: {{|1=expression}} - ditto for expressions containing equal signs.
;Updates:

text: #The code was simplified for better support of optional substitution (= no more parameter defaults), hence empty expressions are not more supported.

text: #Decimal fractions are now kept as is (1.25 results in 01.25), this can be useful for the seconds in timestamps hhmmss.nnn, see ISO 8601.
thread_title:  Usage 

message: Code                               	Result
{{|-1}}             	
{{|123/100}}        	
{{|1+9}}            	
{{|not 10}}         	
{{|1=(7<=8)*9}}  	
{{|(7<=8)*9|2+3}}	
The last example shows that expressions containing "=", "<=", or ">=" won't work directly.
thread_title:  Example 

message: * 
* 
*  (similar)
*  (1= trick)
thread_title:  See also 

message: Add issues below as you see fit, sign with ~~~~
=== Improved code ===
I've written an updated code that will handle being passed no parameters (or a blank parameter). Output in such a case will be blank. The improvement is necessary for a template I'm working on and improves the stability of the current template.
replies: text: {{#if:|{{#ifexpr: 0 <= () and () < 10|0}}}}
New examples:
Code                     	Result
	
      	
The current result for such cases is an error: update since
Code                     	Result
	
      	
Previous test cases still work as expected:
Code                                    	Result
             	
        	
            	
         	
  	
	
--rannpháirtí anaithnid (talk) 12:28, 25 May 2009 (UTC)
p.s. I'd do this myself only I have not been autoconfirmed yet. --rannṗáirtí anaiṫnid (coṁrá) 23:22, 26 May 2009 (UTC)

text: --rannṗáirtí anaiṫnid (coṁrá) 12:15, 28 May 2009 (UTC)
thread_title:  Discussion 

message: I've written an updated code that will handle being passed no parameters (or a blank parameter). Output in such a case will be blank. The improvement is necessary for a template I'm working on and improves the stability of the current template.
replies: text: {{#if:|{{#ifexpr: 0 <= () and () < 10|0}}}}
New examples:
Code                     	Result
	
      	
The current result for such cases is an error: update since
Code                     	Result
	
      	
Previous test cases still work as expected:
Code                                    	Result
             	
        	
            	
         	
  	
	
--rannpháirtí anaithnid (talk) 12:28, 25 May 2009 (UTC)
p.s. I'd do this myself only I have not been autoconfirmed yet. --rannṗáirtí anaiṫnid (coṁrá) 23:22, 26 May 2009 (UTC)

text: --rannṗáirtí anaiṫnid (coṁrá) 12:15, 28 May 2009 (UTC)
thread_title:  Improved code 

message: Why does this not use the built-in padleft function? --- RockMFR 21:45, 25 July 2009 (UTC)
replies: text: The original creator probably didn't know about that function. I didn't when I updated the code (above). Looks like a candidate to be simplified. --rannṗáirtí anaiṫnid (coṁrá) 00:57, 26 July 2009 (UTC)
replies: text: :Oops. I didn't realize this also supports non-integers. Nevermind. --- RockMFR 01:39, 26 July 2009 (UTC)
thread_title:  padleft