PADDING WITH ZEROS

in design I am trying to add leading zeros to a data selection, there needs to be 8 digits example the number 45.25 needs to show

00004525 - all right justified

I’m using

=@(1,14,14)+@(1,15,25)+‘000000’ +@(1,34,39)+@(1,41,42)+‘000000’ +@(1,84,89)+@(1,91,92)+‘0’

but I get 6 zeros no mater what my number is in the select

like

number 45.95

I get

0000004595

it needs to be 8 digits like

00004595

Hello Northcoast,

Please ask your request on the PlanetPress Suite 7 forums, located on Objectif Lune Tech Support Self Help - Forums powered by UBB.threads™

This section is for our newer product, PlanetPress Connect.

In Connect it could be something like this: :wink:

var val = "45.25";
var str = val.replace('.',''); //remove the decimal sep
var padded = pad(str,8); // call our simple pad() function
results.text( padded ); // replace the results of our query with the padded value

function pad(num, size) {
    var s = "000000000" + num;
    return s.substr(s.length-size);
}