Formatting ?

  • Thread starter Thread starter schneider
  • Start date Start date
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
 
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.
 
Back
Top