Round To Half, Always In Positive Direction?

Aug 25, 2011

How do I achieve the below rounding?

0.012608376 > 0.015
2.1 > 2.5
2.4 > 2.5

[code].....

View 3 Replies


ADVERTISEMENT

Asp.net - Big Negative Number - Positive Giving Positive Only?

Apr 15, 2011

I have temp2 value -52340.0 and hslColor.Luminosity is 240.0 When Dim temp1 As Double = (hslColor.Luminosity - temp2). It shoud give -ve number but I am getting always positive number. results should nbe -52100, but I am getting +52100. How to handle this?

View 4 Replies

Richtextbox To Take Up Half Half The Form Width?

May 23, 2012

I have 2 Richtextboxws on the form. I need for each textbox to take up half the form width and full height. also, I need those textboxes to keep the above mentioned proportions even when then the form size is changed on the screen.

View 1 Replies

Let Textbox1 Only Enter Positive Whole Numbers And Positive Decimal Numbers?

Jan 10, 2012

How to let textbox1 only enter positive whole numbers and positive decimal numbers

View 4 Replies

Copy Left Half Of A Picture And Paste It Over The Right Half Of The Picture?

Feb 28, 2010

how to copy the left half of an image, in my case its the let half of a .jpg of a whale, and "paste" it over the right half of the image. Any help would be great, here is some code that might have something to do with it, i would prefer that i could get an answer that accomplishes this by modifying this code but if not that's cool. picture should go from looking like [] to [[

Dim mb, rb As Bitmap
Dim x, y As Integer
Dim r, g, b As Integer

[code]....

View 3 Replies

Passlist Separator Program Will Not Let Read And Write Half Of A File To One File, Then The Other Half To Another File?

Nov 8, 2011

What my program does is load a file (password list), then progressively reads each line of text in the file whilst writing each line to a new file. After X amount of lines have been written, it should start writing the lines of text to a new document until the initial password list has been split into X amount of password lists. The problem I have is that after hours of tweaking, all I can get it to do is write either blank ocuments, or write all of the lines to only one file. I really need it to be able to split into multiple files, preferably at runtime rather than loading a whole text document into the program in a textbox or array then writing it to new files.Below is the source:

Imports System
Imports System.Windows.Forms
Imports System.IO

[code].....

View 11 Replies

Round Up The Numbers - Round Up The "TotalVolume" And "AvgHL" With 2 Decimal Places

Apr 27, 2010

With the following problem which I want to round up the "TotalVolume" and "AvgHL" with 2 decimal places. However, my ListView2 is still showing as the following example.

Example:
ID --------- Average H/L ----------- Average Volume
12 --------- 1.230000 ----------- 4251.230000
17 --------- 0.560000 --------- 12345.560000
23 --------- 0.320000 --------- 2345.010000
54 --------- 1.230000 --------- 122.550000

Dim conn As SqlConnection
conn = New SqlConnection(Source)

conn.Open()

[CODE]...

View 6 Replies

Mirror Image - Mirror The Top Half Of An Image Of The Bottom Half?

Feb 28, 2010

how to mirror the top half of an image of the bottom half, i already mirrored the left half of an image over the right half, as shown in the 2nd block, but i need to modify the 3rd block correctly to get the top half to mirror over the bottom half, how do i do this, - visual basic express 2008

Dim mb, rb, cb, db As Bitmap
mb = Bitmap.FromFile(tbFileName.Text)
cb = Bitmap.FromFile(tbFileName.Text)[code].....

View 2 Replies

Convert Negative Integers To Positive Ones?

Jun 22, 2011

I need to convert a negative integer to a positive one.

View 14 Replies

Convert Positive/negative Number?

Dec 19, 2005

Is there a built-in function in .NET (VB) to convert a negative number into a positive, and vice-versa?I usually end up just using:NegNum = PosNu - (PosNum * 2)PosNum = NegNum- (NegNum * 2)

View 6 Replies

Disable In Textbox Has Anything Else Besides Whole Positive Integers?

Jun 12, 2009

For the life of me, I cant seem to do this. In the textbox_textchanged method, I want Button to disable in textbox has anything else besides whole positive integers.If text box has positive integers, i want button1 to enable.

View 6 Replies

Output Divisors Of A Positive Integer?

Aug 30, 2009

how I could go about doing it. The console application needs to input a positive integer and output its proper divisors.

[Code]...

View 17 Replies

Positive Decimal In Datagridview Columns?

Jun 1, 2011

How to set in datagridview column to force it only accept positive decimal value??

If negative , then raise dataerror event??

View 4 Replies

Show Positive Symbol For Integer?

Feb 15, 2009

How do I have a positive number show the "+" sign before the number.

I feel that this should be easy but my searches must be too broad because I get way more info than I want and don't seem to find the easy fix.

View 3 Replies

Test An Integer Value To See When It Is Positive / Negative?

Sep 18, 2009

I am looking for a way to test an integer value to see if it is positive or negative so I can perform the required actions.

View 1 Replies

New 2 Vb And Needing Some Direction?

Jan 5, 2012

im searching for code examps on how to search multi-websites from user input within a desktop apps textbox and return active links into a webbrowser within the app...this even possible?

View 4 Replies

Converting EST To CET, Half Way There?

Dec 4, 2009

Welp, I got half way there, I can convert and add 6 hours to the text in the textbox for CET_Hours.Text. The trouble is, what about when the CET part of the program is supposed to say that it's the next day...?

Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If DateAndTime.Now.Hour > 11 Then[code]....

Like I said up top, it was easy to figure out how to add an additional 6 to the text in the textbox for CET_Hr.Text, and even display if it's AM or PM, ... So okay, that's that, now when it goes over 12PM and goes into Am, meaning, when I'm adding 6 to the text, If I didn't correct it, it would say... Say for example if it were 11PM now, EST, and I added 6, it would read, CET_ Hr.Text = 16 right, ... So how do I tell the program or the text in the textbox, that it't the next day... or better yet, when we get to the end of this month, 12.31.2009, and it becomes 01.01.2010 in CET, how do I do that, because I'm just so freakin perplexed about that it's crazy... Should I just give up, and just have a clock that tells me that it's 6 more hours then the bottom text boxes...?

View 4 Replies

Possible In An Datagridview To Use Different Formatting For Negative, Positive And Zerovalues?

Jan 19, 2009

Is it possible in an datagridview to use different formatting for negative, positive and zerovalues?I want to show positive numbers in black, negative numbers in red, and zero-values hidden.

View 2 Replies

Textbox Maxlength For Positive / Negative Integers

Apr 25, 2012

The problem is simple: I have a form with textboxes, and in one of those textboxes, I want users to enter either a positive or negative 2-digit number. I'm looking for an easy way to enforce this restriction, i.e. without having to parse the number and check whether its absolute value is below 100.

[Code]...

View 2 Replies

VB Program That Requests A Positive Integer As Input?

Nov 28, 2009

i did this much but something doesn't seem right...the question is A Visual Basic program that requests a positive integer as input, and carries out the following steps:If the number is even, divide it by 2.Otherwise, multiply the number by 3, and add 1 to the result. Repeat this process with the resulting number, and continue repeating until the number 1 is reached.After the number 1 is reached, displayed how many iterations were required to reach the number 1. (Hint: a number is even if number Mod 2 = 0.)

Private Sub btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn.Click
Dim num, multiply, divide As Double

[Code]...

View 4 Replies

Change Direction Of RowHeaders In DGV

Feb 8, 2012

Is that possible to change the RowHeaders in DGV from right to left. not by change the Direction of DGV from right to left means start from the last column not from the first colum.

View 2 Replies

Changing Direction Of The Code?

Mar 5, 2012

Anyway this is my code right now so I am not blank.Code removed.Not sure if it is very hard to understand but I am currently working on a project and what this code does is finds a blue ball on thewhole screen then moves the cursor position on the blue ball it just found.If it doesn't find it, will show a msgbox Quite simple.

View 12 Replies

Getting WPF DataGrid Selection Direction?

Jan 20, 2011

I'm using SelectionMode as Extended (multi select) with WPF DataGrid.The SelectedIndex value always returns the first row that was selected, irrespective of the selection direction. For example, if I start at index 0 and end at 4, I can work with it fine. But if I start from 4 and go to 0, SelectedIndex returns 4 and I don't have a clue to add the number of selected cells or subtract.Is there a way to find the selection direction?

View 1 Replies

How To Draw A Rectangle In All Direction

Sep 28, 2009

i've found this code on the web that allow me to draw a rectangle and keep the Image inside this. But there is a way to make draw this rectangle in all the direction and not only from left to right and top to bottom?

Public Class frmSS
Private Declare Auto Function BitBlt Lib "gdi32.dll" ( _
ByVal hdcDest As IntPtr, _

[code]......

View 4 Replies

LinearGradientBrush With Degree Direction?

Jun 1, 2012

I want to paint the background of a form with gradient using the LinearGradientBrush; but I have troubles using degrees.Basically, I want using linear gradient in diagonal.

View 1 Replies

VS 2008 Could Someone Point In The Direction?

Sep 1, 2009

of a tcp server/client project example so that I can make my won tcp chat or something.

View 2 Replies

VS 2008 Getting Started In The Right Direction?

Apr 5, 2011

I have a project that needs to open a CSV file that is 3.7gb in size. It is data that was exported from a database (why on earth anyone would export it to ONE file, is beyond me)

Excel/Access can't open the file because it is more than 256 columns and greater than 65000+ rows. I was able to split the file into seperate files with 50,000 rows in each. I wan't to automate this and export only data by a specific state, and perhaps add it to a database or excel file, should the rows stay below the limit.

I found a project that splits the CSV file... perhaps I can just parse the data while splitting the file.

View 11 Replies

VS 2008 Point Me In The Right Direction?

Jul 30, 2009

Here is what I have: An excel sheet full of Companies, Contacts, and emails.

There are duplicates of all three. Here is what I need to do: Strip out all duplicates based on email.

Is there anyone that can point me in the right direction?

View 11 Replies

C# - Format Double As String With Positive / Negative Symbol?

Aug 25, 2011

I'm outputting a Double that can be either (+) or negative (-). If the number is a negative the symbol (-) is included automatically, is there a way to do this for positive numbers as well?

The only (horrible) way I can do this is :

If MyNumber <= 0 then
string.Format("{0:0.00}", MyNumber)
Else
string.Format("+{0:0.00}", MyNumber)
End If

View 2 Replies

Develop An Application Which Accepts A Positive Integer Value From The User?

Nov 8, 2011

develop an application which accepts a positive integer value from the user and outputs the sum of all integers between 0 and the given integer.

View 7 Replies







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