Blame | Last modification | View Log | RSS feed
!goto $wims_read_parm
:def
title=Percent
synonyme=percentage
input=function
!exit
:proc
formula=!rawmath $formula
formula2=!rawmath $formula2
formula2=!trim $formula2
!if abs($formula2)<=0
formula2=
!endif
wims_print_precision=$[min(5,$precision)]
!if $formula2!=$empty
result=$[100*($formula)/($formula2)]
!else
result=$[($formula)*100]
!endif
!exit
:output
!if $formula2!=$empty
!htmlmath $formula
is $result% of
!htmlmath $formula2
.
!else
!htmlmath $formula
= $result%.
!endif
!exit