|
|
Hi Guys,
Anybody knows the way to format the String to get currency in the following format.
-$12,458.40 when the input is -12458.40.
i tried the following
String.Format("{0:c}",-12458.40);
but the result is (-$12,458.40)
|
|
|
|
|
rajmahen wrote: but the result is (-$12,458.40)
But this is the same thing that you wanted.
Actually if you format using {0:c} it will format according to what defined in your local settings.
|
|
|
|
|
Okay....then where i can change dat local setting in my browser or can i change it thro code itself??...
if it is possible in code
can you give me d snippet??
i hav seen this format change settings in MS Excel...is dat possible in ASP.net also?
modified on Monday, November 2, 2009 10:23 AM
|
|
|
|
|
Hi,
I Have a Problem,
I Want To Unzip My File Using C# Code On Server ...
Is There Any Solution......
|
|
|
|
|
|
Use WindowsBase .
Remember, it needs ContentType Xml to be inside the zip file to work correctly.
Otherwise you might go for depreciated VJslib.dll also
|
|
|
|
|
For Example.
string myString = "This my Code : 589745";
string myCode = myString.GetNumber();
myString.GetNumber method returns number from string variable.
I can write method to get number from string but I just need to know how to implement class that extend base type functionality.
thanks
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Why do you need to write a new class when there is already a concept of Extension Function..
use like this
public int GetNumber(this string str)
{
}
Now to call just use myString.GetNumber .
|
|
|
|
|
Abhishek Sur wrote: Now to call just use myString.GetNumber.
I am not able to get it in intellisense when I am trying to get myString.GetNumber.
Thanks
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
I got the solution.I got error at compile time that says 'Extension methods must be static' so I create one class named StringHelpers as static.
public static class StringHelpers
{
public static int GetNumber(this string str)
{
return 1;
}
}
Thanks
Imrankhan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Yes .. sorry.. I just overlook on that.
Really extension functions should be declared as static .
I think now you have made it working ..
cheers...
|
|
|
|
|
Hello,
Is their a way to open a dwg file format in IE.
I tried open it using the response.outputstream but it appear as text and not the drawing.
regards.
dghdfghdfghdfghdgh
|
|
|
|
|
Browser cant show binary content.
|
|
|
|
|
hii m using shopping cart in my application.
i have created it but it is open for anonymous user i want that only after log in one can use this facilitie.any idea or link.m using csharp(asp.net 2.0).thnks....
|
|
|
|
|
Create a Session when the user logs in ....
and check that session when a user tries to add an item into the
cart.
|
|
|
|
|
thnks....
can u give me any link or example which follow this.....
thnks......
|
|
|
|
|
|
|
Hi,
How to align the image to center when using e.Graphics.DrawImage
eg:
e.Graphics.DrawImage(image, new Point(150, 0));
i need to display the image in the center of position x ie 150
Thankyou
YPKI
|
|
|
|
|
How does this relate to ASP.NET ?
You do what you're talking about by using maths to calculate the point based on the two image sizes.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hello,
I want to insert only time into SQL. I have datetime field in database & also have taken datetime picker (ew) on the page.
How it can be done?
Please help me..
Thanx..
|
|
|
|
|
I'm not sure if there's a time field in SQL. If there's not, just set the date to always be the same, and ignore it and only use the time portion.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Sir,
I used the timepicker from EW & have written the statement as
objData.AddParameter("InTime", tpInTime.SelectedTime);
Here, tpInTime.SelectedTime has datetime as return value which is same in db.
Even its not fare.
Thanx Sir.
|
|
|
|
|
deepseeindeepsy wrote: I want to insert only time into SQL
You don't have to do that. Use datetime only and when you read, use the functions provided by SQL server to get only time.
Best wishes,
Navaneeth
|
|
|
|