Solved

Function to add a decimal place.

Posted on 2006-07-12
3
142 Views
Last Modified: 2010-04-30
I use the function below to format a date in an ASP page.  Is there something I could use to add a decimal to a number from our database?

Database #:
1179

Should be:
1.179

Date Function:

<%
function formatDate(unformattedDate)
myYear = Left(unformattedDate, 1)
myMonth = Mid(unformattedDate, 2, 2)
myDay = Right(unformattedDate, 2)
formatDate = myMonth & "/" & myDay & "/" & myYear + 2000
end function
%>
0
Comment
Question by:bschwarting
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
rettiseert earned 500 total points
ID: 17092691
??? can you just do a division? : number / 1000 ?
0
 
LVL 1

Author Comment

by:bschwarting
ID: 17092942
ha-ha, you get so technical sometimes, you don't think of the easy options!  that might work!

this might be an ASP question, but how would I divide a value in a response.write?

<% Response.Write Request.Querystring("val1") %>

or

<%Response.Write(MBRSEP)%>">
0
 
LVL 1

Author Comment

by:bschwarting
ID: 17093964
i did:

<%MBRSEP = Request.Querystring("val1")%>

<%Response.Write(MBRSEP/1000)%>

and it works great.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question