Formatting ?

S

schneider

I'm trying to format an object using string variables. Just can't seem to
get it to work.

Currently using System.String.Format(renderArgs.Format, renderArgs.Item)
Seems to have weird results, sometimes just show my format, sometimes blows
up, sometimes works with limited formats...


Example goal:

Function FormatObject(value as object, frmat as string) as String
Dim ret as string

ret=value.ToString(frmat)
return ret
End Function

Any ideas?

Thanks,
Schneider
 
P

Phill W.

schneider said:
Currently using System.String.Format(renderArgs.Format, renderArgs.Item)
Seems to have weird results, sometimes just show my format, sometimes blows
up, sometimes works with limited formats...
Function FormatObject(value as object, frmat as string) as String
Dim ret as string

ret=value.ToString(frmat)
return ret
End Function

OK, could be done in three lines ...

Function FormatObject(value as Object, fmt as String) as String
Return value.ToString(fmt)
End Function

.... but otherwise, it looks fine.

Show us a few calls you've made to the above function, what you got out
of it, and why you think they're wrong ...

Regards,
Phill W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top