Combination of lpad and formatting :)

Recent post, from BIP

wanted to , format the number to two digits, and then fill the left over space with * and then prepend with$ sign.


To format
?format-number(number(10),’###.00’)?
?format-number(number(10.1),’###.00’)?
?format-number(number(10.171),’###.00’)?

use this,

then to prepend them,

if it is one time usage try this

?variable:form_num ;format-number(number(10.171),’###.00’)?
?xdofx:’$’||lpad($form_num,15,'*')?


if it is in loop, then

?xdoxslt:set_variable($_XDOCTX, 'x', xdoxslt:lpad(format-number(number(99.171),’###.00’),15,’*’))?
$?xdoxslt:get_variable($_XDOCTX, 'x')?

Comments

Popular posts from this blog

BIP Formatting

Repeat Table Header in all pages in BIP

Limit rows per page