Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/06/2007, 03:28
tammander
 
Fecha de Ingreso: enero-2006
Ubicación: Torroles (Costa der Só)
Mensajes: 1.017
Antigüedad: 19 años, 3 meses
Puntos: 7
Re: Quitar coma decimal y rellenar con ceros a la izquierda

Código:
function miformato(num, caract)
    dim strNum, numCaract
    strNum = CStr(num)
    if isNumeric(num) then
          strNum = replace(strNum,",","")
          ' Me curo en salud con los dos posibles formatos :P
          strNum = replace(strNum,".","")
          numCaract = caract
          if not isNumeric(caract) then numCaract = 10
          if len(strNum) < numCaract then  strNum = String((numCaract-len(strNum)), "0") & strNum
    end if
    miformato = strNum
end function
USO:

response.Write("mi formato da " & miformato(23.45,10))


No lo he probado. Espero que funcione :P


Un saludo
__________________
"Tus pecados son el estiércol sobre el que florecerán las flores de tus virtudes" - Gerald Messadié -