445,704 Members | 1,867 Online
Need help? Post your question and get tips & solutions from a community of 445,704 IT Pros & Developers. It's quick & easy.

 P: n/a Hi All, I have a application which reads from a dat file.I import this into the database.While exporting this back I want to format the data so that the alignment is proper. I have the data in decimals which have to be padded with 0 either to right or left depending on the digits.((totals to 13 digits) For some the data is like 58049.859 which is to be padded to make it as 58049.859000(totally 13 digits) Some are like 49.859 which is then to be padded as 00049.859000 or 9.85 to be padded as 00009.8500000. I hope you can understand what I am trying to do here. As the data is inconsistent,I am not sure how to do this. I am able to do the padding for a regular number(without decimals) but confused to do the same for decimals. Thanks for any help. Roy Dec 5 '07 #1
3 Replies

 P: n/a Roy

 P: n/a On Wed, 5 Dec 2007 13:11:19 -0800 (PST), Roy wrote: >Hi All,I have a application which reads from a dat file.I import this intothe database.While exporting this back I want to format the data sothat the alignment is proper.I have the data in decimals which have to be padded with 0 either toright or left depending on the digits.((totals to 13 digits)For some the data is like 58049.859 which is to be padded to make itas 58049.859000(totally 13 digits)Some are like 49.859 which is then to be padded as 00049.859000 or9.85 to be padded as 00009.8500000.I hope you can understand what I am trying to do here.As the data is inconsistent,I am not sure how to do this.I am able to do the padding for a regular number(without decimals) butconfused to do the same for decimals.Thanks for any help.Roy Above, you say 13 digits, but your examples are all 5.6 (11 digits). Not sure which you want. Adjust the format string below to suit your needs: ?format(49.859,"00000.0000000") 00049.8590000 ?format(9.85,"00000.0000000") 00009.8500000 You didn't make it entirely clear what you want to do with the formatted output. (report, form, write to file, ???). Store the data as numeric then format the output as shown above, when needed. HTH, Arch Dec 5 '07 #3

 P: n/a On Dec 5, 4:46 pm, Arch wrote: Hi All, I have a application which reads from a dat file.I import this into the database.While exporting this back I want to format the data so that the alignment is proper. I have the data in decimals which have to be padded with 0 either to right or left depending on the digits.((totals to 13 digits) For some the data is like 58049.859 which is to be padded to make it as 58049.859000(totally 13 digits) Some are like 49.859 which is then to be padded as 00049.859000 or 9.85 to be padded as 00009.8500000. I hope you can understand what I am trying to do here. As the data is inconsistent,I am not sure how to do this. I am able to do the padding for a regular number(without decimals) but confused to do the same for decimals. Thanks for any help. Roy Above, you say 13 digits, but your examples are all 5.6 (11 digits). Not sure which you want. Adjust the format string below to suit your needs: ?format(49.859,"00000.0000000") 00049.8590000 ?format(9.85,"00000.0000000") 00009.8500000 You didn't make it entirely clear what you want to do with the formatted output. (report, form, write to file, ???). Store the data as numeric then format the output as shown above, when needed. HTH, Arch- Hide quoted text - - Show quoted text - lyle and Arch, Thanks for your solutions.This is to format and then write to a file. Roy Dec 6 '07 #4

### This discussion thread is closed

Replies have been disabled for this discussion.