Simple Format text Question

  • I am trying to format a string field using VBScript which contains numbers to include a decimal point:

    currently looks like '4550' I want it to look like '45.50'. I am hoping not to have to convert this field to numeric.

    Thanks!

  • If all of your data elements in that field will always be four characters you could simply use the LEFT and RIGHT functions and concatenate the results with a '.' in between. If the length or number of characters will vary then you will need to use the LEN function as well.

    LEFT(myfield,2) + '.' + RIGHT(myfield,2)

    - or -

    LEFT(myfield, LEN(myfield) -2) + '.' + RIGHT(myfield,2)

    ~Michael

    Michael Weiss


    Michael Weiss

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply