Forums
 This topic is locked 
             Decimal problem
 Posted 01 Oct 2002  02:25:14 
  1 
     has   voted 
  01 Oct 2002  02:25:14 Matt Flood posted: 
 This should be an easy problem to fix. There are a couple ways to solve it but i want the best solution. I am ussing Dreamweaver MX, IIS, and Access 2002. I am pulling data from the database. I am pulling a number like 1704370 I want it to show up as 1.704370 who has the best idea of fixing the problem.
Replies
 Replied 02 Oct 2002  16:50:47 
   02 Oct 2002  16:50:47 Ned Frankly replied: 
  This should work (off the top of my head, though, so check syntax):
<%
var OriginalNumber = String(rsTable.Fields.Item("Number"
.Value)
var NewNumber = OriginalNumber.substr(0,1)+"."+OriginalNumber.substr(1,OriginalNumber.length-1)
%>
Then
<%=NewNumber%>
where you want to display it.
Good luck!
Ned Frankly
  <%
var OriginalNumber = String(rsTable.Fields.Item("Number"
var NewNumber = OriginalNumber.substr(0,1)+"."+OriginalNumber.substr(1,OriginalNumber.length-1)
%>
Then
<%=NewNumber%>
where you want to display it.
Good luck!
Ned Frankly