Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String.Format
Message
 
 
To
18/02/2013 13:35:25
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01566272
Message ID:
01566295
Views:
36
>>If I remove D16 from above it seems to pass that line OK.
>
>(1) Do not convert sale_no and trans_no ToString()
>(2)
>
>Console.WriteLine("{0:0000000000000000}", 123);
>
>
>
>>The VFP code is
>>
>>
>> scan
>>               lvRetVal=lvRetVal+;
>>                  transform(extension, '$,$$$,$$9.99')+'  '+;
>>                  transform(date_time)+'  '+;
>>                  padr(iif(department='**TRANS** ', message, department+'/'+category+'/'+item),32)+' '+;
>>                  chr(13)+chr(10)+;
>>                  '  '+transform(sale_no, '9999999999999999')+transform(trans_no, '9999999999999999')+' '+;
>>                  operator+' '+;
>>                  salespoint+chr(13)+chr(10)+chr(13)+chr(10)
>>            endscan
>>            lvRetVal=lvRetVal+;
>>               '------------'+chr(13)+chr(10)+;
>>               transform(lnInvBal, '$,$$$,$$9.99')+chr(13)+chr(10)+;
>>               transform(lnThisSale, '$,$$$,$$9.99')+'  Against This Sale'+chr(13)+chr(10)
Thanks, I seem to be able to get the exact same output using
    displayString.AppendFormat("{0,12:$#,##0.00}  {1}   {2}{3}   {4}{5}  {6}  {7}{3}{3}", 
                                            Convert.ToDecimal(row["extension"]), Convert.ToDateTime(row["date_time"]), message, Environment.NewLine,
                                            row["sale_no"].ToString().PadLeft(16), row["trans_no"].ToString().PadLeft(16), 
                                            row["operator"].ToString(), row["salespoint"].ToString());
                                    }
                                    displayString.AppendLine("------------");
                                    displayString.AppendFormat("{0,12:$#,##0.00}{2}{1,12:$#,##0.00}  Against This Sale{2}", balance, saleTotal, Environment.NewLine);
                                    messageText = displayString.ToString();
Actually, looking closer I see few minor discrepancies. I am going to work on that.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform