Solved

Function to add a decimal place.

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vbModal 12 65
Advice in Xamarin 21 107
Powerpoint 2013: Change cell reference in excel link 3 119
Fastest way to find and count same items VB6 16 43
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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

680 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