Results 1 to 4 of 4

[solved] convert variable length decimal to fixed string w/left and right padding

Threaded View

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003
    Posts
    2

    [solved] convert variable length decimal to fixed string w/left and right padding

    Hello,
    I need to convert a decimal to a fixed length 15 character string. The decimal varies in length, both to the left and right of the decimal. When converted to a sting, the right 8 characters represent the characters to the right of the decimal and the string cannot exceed 15 characters. Variable length padding is required on each side of the decimal.

    The first thought is create an UDF, that might be wrong. I've tried nesting various if, trim, find, contatenate, etc...and am honestly out of ideas.

    e.g. 1.23 converted to string is 000000123000000
    e.g. 1.234 converted to string is 000000123400000
    e.g. 111.234 converted to string is 000011123400000

    Please help!
    Last edited by jayz2949; 10-31-2012 at 10:20 PM. Reason: [solved]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1