Results 1 to 2 of 2

Thread: Javascript: Data conversion

Threaded View

  1. #1

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550

    Javascript: Data conversion

    I have the following line of code, which results in, for example, 0170.00 being entered in the text field:
    Code:
    frmMain.txtMinimum.value = arrCompanies[intCheckLoop].slice(48,52) + "." + arrCompanies[intCheckLoop].slice(52,54)
    What would be the best way, using Javascript, to get any leading zeros removed? I'm used to VB where I'd just use:
    Code:
    frmMain.txtMinimum.value = Value(arrCompanies[intCheckLoop].slice(48,52)) + "." + arrCompanies[intCheckLoop].slice(52,54)
    Cheers!
    Last edited by coox; Jul 8th, 2003 at 10:39 AM.
    Nick Cook
    VB6 (SP6)

Posting Permissions

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



Click Here to Expand Forum to Full Width