View Complete Thread | FoxWeb Forum Home
Date:    Msg ID:   
From:    Thread:   
FoxWeb uses the following code to convert numeric values within merge delimiters to strings:

IF M.vInput = 0
  RETURN '0'
  LOCAL StrNum, StrExp
  StrNum = LTRIM(STR(M.vInput, 25, 18))
  IF 'E' $ M.StrNum
    StrExp = SUBSTR(M.StrNum, RAT('E', M.StrNum))
    StrNum = LEFT(M.StrNum, RAT('E', M.StrNum) - 1)
    StrExp = ''
  IF '.' $ M.StrNum
    * Strip zeros past the decimal point
    DO WHILE RIGHT(M.StrNum, 1) == '0'
      StrNum = LEFT(M.StrNum, LEN(M.StrNum) - 1)
    * Strip decimal point if it is at the end
    IF RIGHT(M.StrNum, 1) == '.'
      StrNum = LEFT(M.StrNum, LEN(M.StrNum) - 1)
  RETURN M.StrNum + M.StrExp

If the above code is not adequate for your needs then you should use your own algorithm to do the conversion, e.g.:

<%=LTRIM(STR(table.numeric, 10, 2))%>

FoxWeb Support Team

Sent by mike hood on 01/23/2002 09:24:50 AM:
when i display a numeric field from a table <%=table.numeric%> into the body of the html.  the results on the form dont display the exact table value.
example: table==3.00 // html == 3
             table==3.17 // html ==3.169999999999

++ in fox using the str command with truncate the .00 also

how do u get the html to display the tables exact values.