VishalMistry
11th April 2015, 07:52
Hi,

Hello,

I want to format number (with four leading zeros ed.00001) using sprintf and then concatenate it with string C215.

Can anybody guide how this can be done ?

Vishal

sachinbaan
11th April 2015, 11:56
hi,
try this,
temp.pono = str$(1) |* first free number
temp.pono = shiftr$(temp.pono)
target = str.replace$(temp.pono," ","0")
o.num = "C215" & target


o.num is string(9) fixed
target is string(5) fixed

vahdani
11th April 2015, 22:27
Use edit$() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_formatting_io_edit) instead:


result.string = "C215" & edit$(some_number, "99999")

VishalMistry
14th April 2015, 07:26
Hello,

The edit$() function solved my issue and it works as expected.

Thanks a lot.

Vishal