Customer Portal

Sequence with leading zeros

Comments 2

  • Avatar
    dpavlis
    0
    Comment actions Permalink
    Well, sequences in Clover are numbers, what you are describing is a string representation. You might use function like this to format your sequence number to format you described:

    function string formatNum(integer num){
    string fmstr=toString(num);
    return left("00000000",8-length(fmstr))+fmstr;
    }


    Usage:

    formatNum(3);
    formatNum(3333);
    formatNum(123456);


    Hope it helps.
  • Avatar
    holaketal
    0
    Comment actions Permalink
    Hello,

    thank you very much! It's perfect!

    Kind regards,
    Holger

Please sign in to leave a comment.