Difference between revisions of "MessageBox"

1,641 bytes removed ,  04:21, 10 June 2006
→‎Displaying Variables: Use same template for Message and Messagebox
imported>JOG
m
imported>JOG
(→‎Displaying Variables: Use same template for Message and Messagebox)
Line 19: Line 19:


== Displaying Variables ==
== Displaying Variables ==
 
{{MessageFormating}}
===Formatting notation===
 
'''%.2f'''
 
This means format the variable with 2 decimal places.
 
 
'''%.0f'''
 
This will format the variable with 0 decimal places, so is the normal choice for integers.
 
 
'''%5.0f'''
 
The number in front of the point specifies the minimum width of the number. In this case, there will always be enough space in front of the number for 5 digits:
Number    12 wins
Number  1234 wins
 
 
 
===Formating switches===
 
The following formatting switches can be used in Oblivion. Put them in any sequence right after the '%'
{|border="1" cellpadding="5" cellspacing="0"
|-
! style="background:#efefef;" | Switch
! style="background:#efefef;" | Function
|-
|<nowiki>+</nowiki>
|Display + in front of positive numbers
|-
|<nowiki><Space></nowiki>
|Leave a leading space in front of positive numbers
|-
|<nowiki>-</nowiki>
|Use left-aligned formation instead of right alligned.
|-
|<nowiki>0</nowiki>
|The filling-char used for formatting is '0' instead of ' '
|}
 
 
 
 
===Other Functions===
 
'''%g'''
 
This usually works just like "%.0f", displaying 0 decimal places. When the number is 1000000 or larger, though, the game diplays it in scientific notation (1E+006)
 
 
'''%.3e'''
 
Shows numbers in scientific notation (123000 = 1.23E+5)
 
 
'''%%'''
 
Use this to display a percent-sign in the messagebox
 
 
 
 
===Examples===
 
'''Messagebox "Var1:% 5.2f / Var2:% 5.2f"'''
"Var1:  123.45 / Var2:  -123.45"
 
'''Messagebox "Var1:%05.2f / Var2:%05.2f"'''
"Var1: 00123.45 / Var2:-00123.45"
 
'''Messagebox "Var1:%+-5.0f / Var2:%+-5.0f"'''
"Var1:+123  / Var2:-123  "
 
'''Messagebox "Var1:% .3e / Var2:% .3e'''
"Var1: 1.234E+2 / Var2:-1.234E+2"
 


==See Also==  
==See Also==  
Anonymous user