Add Rounded Doubles To Label

Mar 22, 2010

I'll use the Math.Round function, but there happends something strange. If i have a numer like 10.0012356 he adds with round(10.0012356) only 10, and not the wanted 10.00 But if i have 10.534, he adds 10.53, so then its ok. How can i change that? I use this code right now:

double PriceIn = PriceExcl * ((BTW + 100)/100);
lblPriceEx.Text = "€" + Math.Round(PriceExcl, 2).ToString();
lblPriceIn.Text = "(" + Math.Round(PriceIn, 2).ToString() + "incl.)";

View 4 Replies


Similar Messages:

ADO.NET :: Stored Procedure And Decimal / Doubles

Nov 25, 2010

My web page allows customers to search products by selecting criteria. In this example, they can choose a height range (we'll use the example between height 2.00 and 2.99). The issue is, the database returns a results which has a height of 3.00 (which is obviously not between 2.00 and 2.99) I am using a stored procedure.

[Code]....

My webpage passes the paramters for @Pr and @Pr2 (which are of type double) to the stored procedure (@Pr = 2.00, @Pr2 = 2.99). My c# code (simplified - FYI, request.QuerysString["p"] returns the string value 2)

[Code]....

You can see from the C# I have commented 2 lines for debugging where I've used the dqsPr variable and where I've typed the number in manually. Regardless of sending either the variable or the actual 'number', the results remain the same (it shows a product which has a height of 3.00). If I change the Stored procedure (for debugging purposes only) Select statement to SELECT DISTINCT PartNumber, Positions, Switch, Post, Profile FROM View WHERE Height BETWEEN 2.00 AND 2.99 ORDER BY Type ASC it works fine. So, it must be due to the passing of the paramaters via ado.net?

View 4 Replies

C# - Nearest Match To Array Of Doubles?

Apr 15, 2010

Given the code below, how do I compare a List of objects's values with a test value? I'm building a geolocation application. I'll be passing in longitude and latitude and would like to have the service answer back with the location closest to those values. I started down the path of converting to a string, and formatting the values down to two decimal places, but that seemed a bit too ghetto, and I'm looking for a more elegant solution.

public class Location : IEnumerable
{
public string label { get; set; }
public double lat { get; set; }
public double lon { get; set; }
//Implement IEnumerable
public IEnumerator GetEnumerator()
{
return (IEnumerator)this;
}
}
[HandleError]
public class HomeController : Controller
{
private List<Location> myList = new List<Location>
{
new Location {
label="Atlanta Midtown",
lon=33.657674,
lat=-84.423130},
new Location {
label="Atlanta Airport",
lon=33.794151,
lat=-84.387228},
new Location {
label="Stamford, CT",
lon=41.053758,
lat=-73.530979}, ...
}
public static int Main(String[] args)
{
string inLat = "-80.987654";
double dblInLat = double.Parse(inLat);
// here's where I would like to find the closest location to the inLat
// once I figure out this, I'll implement the Longitude, and I'll be set
}

View 4 Replies

C# - WebForms Text Input => Doubles & Strings & Booleans?

Apr 14, 2010

Is there a better way to do "input forms" in WebForms?I always end up with code like this:

Double d = 0; // chuckle inside
if(Double.TryParse(myNumberTextField.Text, out d))
{
myObject.DoubleVal = d;
}

Is there a better way to process free-form "numeric" input.

View 1 Replies

SQL Server :: Float Value Not Getting Rounded?

Sep 14, 2010

When i am trying to update a text box value to data base ,say 3.1 it is getting updated as 3.09999... when iam running the stored procedure in query analyzer it is updating correctly. When i am updating the same from page , it is giving this problem. Iam using sql server 2005.

Iam using float for this

View 4 Replies

Want To Use Rounded Corner Button In .net Application?

Nov 3, 2010

I want to use Rounded Corner Button in my asp.net application. Do we have anything in ASP.NET 3.5 which helps us to make a rounded corner button ?

View 5 Replies

Web Forms :: Rounded Corner Box Around Some Textboxes?

Jul 23, 2010

I have created my own login control (for a few reasons) and would like to surround the textboxes and label controls with a rounded corner box. How do I surround the controls with a box and then how do I make its corners rounded? Can I then create a background-color within the box? I have the AJAX toolkit installed and do know how to add extenders but I am kind of stuck on surrounding the controls.

View 3 Replies

AJAX :: Rounded Corners Bug In Firefox?

Jul 13, 2010

I ran across a bug with the asp:RoundedCornersExtender when viewing in Firefox. Sometimes there will be a gap between the top of and the body of the panel. There are a few posts out there about using the solution

[URL] here, but the problem is my hosting account (GoDaddy) won't allow the PrettyUI.dll file to run. Is there any other solution to using the dll file? The source code is available - but I'm not familiar with how I'd go about using the source files in place of the DLL...

[Code]....

View 1 Replies

AJAX :: Rounded Control Css Not Working?

Dec 6, 2010

I was trying to use Ajax rounded corner control. When I set properties for panel from theme folder css file it was not working. If i provide from server control it is ok. Why it is like that?

View 1 Replies

VS 2008 - Create Rounded Button Using CSS Without Using Any Image?

Sep 21, 2010

I am trying to m ake rounded buttons using CSS. I serached a lot on the internet but all the solutions that I found is using the Images. (See URLs Mentioned Below). is it possible to create rounded button using CSS without using any image. [URL]

View 1 Replies

VS 2005 AJAX Rounded Corners Antialiasing

May 3, 2010

When using the rounded corners app in Ajax the corners are bad shaped. I have found this article from Matt Berseth using antialiasing. But I need code I can use for commercial use, do you have any good ideas for solving my problem? I need code for vb.net applications [URL]

View 3 Replies

Web Forms :: How To Create Rounded Corner Webparts In .net 3.5

Nov 20, 2010

I want to create rounded corner webparts in my webpage using .

View 3 Replies

Menu Item With Jquery Rounded Corner?

Sep 8, 2010

I have a requirement by which I need to have something like below as the background of my asp.net menu item background.

NOTE: The menu is populated by sitemapdatasource which is dynamic depending on querystring.

I was doing some googling up and found that I can apply JQuery's rounded corner functionality along with asp.net menu item.

View 1 Replies

AJAX :: Rounded Corner Extender In Datalist?

Feb 12, 2010

I have a datalist which contains only the image button.I want to add rouned corner to this image.So i have used rounded corner extender for image button.But still no rounded corner,but there was no bug.

View 5 Replies

Web Forms :: Make Rounded Rectangular Panels?

May 27, 2010

how to make rounded corner panels.

In default property styles rounded corner is not there.

View 4 Replies

Web Forms :: Menu Control Rounded Corners?

Jul 26, 2010

Yet another post regarding rounded upper corners on an ASP.NET 3.5 horizontal menu control. I've done a day and a half of Googling.Found this link http://forums.asp.net/p/1582204/3989473.aspx. It looked promising but didn't pan out.I got pretty close with some experimenting but it isn't quite there. Could really use some insight or a general agreement that it just can't be done within our constraints.The project is an ASP.NET 3.5 web app. For reasons that are too lengthy to go into here, theoption of using the AJAX tab container has already been examined and rejected. Due to the customer's requirements, we will need to proceed with a menu control set to horizontal display with 2 levels showing. The customer would like to see rounded edges on the top of the menu elements so they have the appearance of tabs. In our corporate-controlled environment, we have as our options the AJAX Control Toolkit, css,

[code]...

View 4 Replies

Data Controls :: GridView With Rounded Corners

Apr 17, 2013

I have a GridView rounded corners. I tried this.. [URL] ..... But it did not work, there was a protuding border towards the right handside.

View 1 Replies

AJAX :: Rounded Corners Extender Not Working In IE

Jun 17, 2013

My Asp site does not support some version of IE and chrome. however its working fine on all version of firefox.

What could be the solution that my site function on all version of IE.

I have used round corner extender on textbox and dropdownlist so some version of IE does not show data in dropdown where i applied round corner extender.

View 1 Replies

AJAX :: Rounded Corners Exentnder On A Master Page?

Feb 3, 2010

I have master page with a rounded corners extender that is not working.

Not sure why. should it work on a master page? Is there anything I need to do to the page that is using the master page?

Here is my master page .aspx

[Code]...

View 1 Replies

SQL Reporting :: Want To Show Report In The Form Of Rounded Corner?

Apr 1, 2011

I am developing one application in SSRS. I want to show my report in the form of rounded corner. to create the rounded corner in the report?

View 1 Replies

AJAX :: Using Rounded Corner Control With User Controls?

Jan 16, 2011

I have created the user control and i am showing it dynamically on the page load event. There will be about 10-15 instance of that user control.

How can i use the ajax rounded control with all the instances of the user control?

In the user control, there is one Div and inside the div there is one place holder which has got few text boxes and label controls.

View 1 Replies

Web Forms :: How To Make Background-image Of Table Or Panel Rounded

Sep 16, 2010

I have taken background-image of a Table and Panel, that image's corner is rectangula. How can i make its corners Rounded ?I searched some online resources, images were made rounded, how to make make background-image rounded on the fly ?

View 7 Replies

Draw Image With Rounded Corners / Border And Gradient Fill In C#

Dec 1, 2010

I've looked everywhere and googled everything and couldn't find anything good. What I need is a class that is able to draw an image (graphics) with rounded corners (different on each corner is a plus) with a border and gradient fill.

All the examples I find have some flaws (like bad quality, missing functionality etc).

I will use this with a ashx that will draw the image and then show it to the user.

View 2 Replies

JQuery :: Decimal Is Rounded Somewhere Between Ajax Call And Request.form?

Feb 15, 2011

I have an ajax call on a page which POSTS data: longitude and latitude. In the Javascript the two variables I pass in "posLong" and "posLat" are both decimals, something like: 50.81472239. When I do request.form in my .aspx.vb page which I've called, the value has now been rounded to 51.

View 4 Replies

JQuery :: Apply Rounded Corners And Drop Shadow Style On A Box?

Mar 5, 2011

how i can apply rounded corners and drop shadow style on a box with jQuery?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved