Bluecrest Posted April 26, 2006 Share Posted April 26, 2006 Hi can you help me? Is there anyone here know some expression in formating the data? I mean formating the date into "Month Day, Year" expression or formating the decimal into 2.00. Please post something related. Thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted April 26, 2006 Share Posted April 26, 2006 If you're using Jscript:datesIf you want to output a floating point number with a specific precision, look at Number.toFixedIf you're using VBscript, you're going to have to find it on your own. VB and all it's demon spawn make me want to chunder. Link to comment Share on other sites More sharing options...
Bluecrest Posted April 27, 2006 Author Share Posted April 27, 2006 Hi! Thank you for your reply. I have seen the links. But I am using the ASP. Can you help me? Thanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 When you use ASP, you either write your code in JScript or VBScript. If you chose JScript, you can use those links (JScript is essentially the same as JavaScript, only Microsoft developed it). If you chose VBScript, then I can't really help you. If you don't know what you are working in, paste some code and I'll tell you. You might also be able to see something at the top that says one of these:<% @LANGUAGE="JScript" %>or <% @LANGUAGE="VBScript" %>That will also tell you what you're working with. Link to comment Share on other sites More sharing options...
Bluecrest Posted April 27, 2006 Author Share Posted April 27, 2006 Ok. Anyway, how could I use javascript in formating my data in the repeater. I have included my repeater code here. <asp:repeater id="rptOrders" runat="server"><ItemTemplate><tr><td align="center"><%# DataBinder.Eval(Container.DataItem,"fnl_datectd")%></td><td align="center"><a href='orderdetails.aspx?id=<%# DataBinder.Eval(container.dataitem,"fnl_id") %>'><%# container.dataitem("fnl_orderno") %></a></td><td>Â Â Â Â Â Â $<%# DataBinder.Eval(container.dataitem,"TOTAL") %></td><td align="center"><%# DataBinder.Eval(container.dataitem,"fnl_stat") %></td></tr></ItemTemplate></asp:repeater> Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 Ahh.. you're working in ASP.NET. Which means you probably are not using JScript, and hopefully not VB.NET (if you are, you have my sympathy).Look on the top of the page, and look for this:<%@ Page Language="xxx" %>Tell me what the 'xxx' part is on your page.There are several built-in converters in .NET, but I'm not much of a .NET pro. But I've got a book sitting next to me, so if I can help you I will. Link to comment Share on other sites More sharing options...
Bluecrest Posted April 27, 2006 Author Share Posted April 27, 2006 Yah I am using asp.net. I have seen my page and it show<%@ Page Language="vb" %> Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 Heh, don't cry, it's ok. A lot of web programmers have an unusual, almost unsettling, fascination with VB.When I get back to my book tomorrow I'll see what I can do. Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2006 Share Posted April 27, 2006 OK, like I said, I'm not that great with .NET but I'll see what I can do.First, you need to import the VB namespace, so add this to the top of your page: <% @Import Namespace="Microsoft.VisualBasic" %> Then when you have your date here: <%# DataBinder.Eval(Container.DataItem,"fnl_datectd")%> I'm not quite sure how to format the code, but I think it should be something like this: <%# String.Format("{0:d}", DataBinder.Eval(Container.DataItem,"fnl_datectd"))%> Again, I'm totally clueless if that is even correct syntax. Here is a page for reference:http://www.aspfaqs.com/ASPScripts/PrintFAQ.asp?FAQID=181 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now