Solved

Function to add a decimal place.

Posted on 2006-07-12
3
140 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now