Formatting ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • schneider

    #1

    Formatting ?

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

    Currently using System.String.F ormat(renderArg s.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(va lue as object, frmat as string) as String
    Dim ret as string

    ret=value.ToStr ing(frmat)
    return ret
    End Function

    Any ideas?

    Thanks,
    Schneider


  • Phill W.

    #2
    Re: Formatting ?

    schneider wrote:
    Currently using System.String.F ormat(renderArg s.Format, renderArgs.Item )
    Seems to have weird results, sometimes just show my format, sometimes blows
    up, sometimes works with limited formats...
    Function FormatObject(va lue as object, frmat as string) as String
    Dim ret as string
    >
    ret=value.ToStr ing(frmat)
    return ret
    End Function
    OK, could be done in three lines ...

    Function FormatObject(va lue 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.

    Comment

    Working...