Convert Decimal Into Time?
Aug 18, 2010
[code]...
Very simple, I click a button and it shows the answer in the label. The answer to this is: 00:02:38 (according to excel)
But I want my Vb.net to change the decimals into the time as excel would do so. The answer vb gives me is: 0.001833786. So how can I change a decimal into a time?
View 5 Replies
ADVERTISEMENT
Jun 21, 2009
display a Decimal (or double) to elapsed time [h]:mm:ss (hours:minutes:seconds)using vb.net?
example:
if you were to type "1.34666666666667" into a cell in Excel then choose Custom Format [h]:mm:ss The result is an elapsed time of "32:19:12". Using the OADate function only runs on a 24 hour clock so this does not work for longer durations unfortunately...
View 4 Replies
Mar 24, 2010
I want to convert e.g. 21/06/2009 15:30:00 to seconds or a decimal number. Just like PHP, which uses a reference date (01JAN1970)
View 4 Replies
Dec 20, 2010
how do you convert a decimal ( decimal place holder = dot) to a decimal (decimal place holder =comma)?
View 6 Replies
Sep 6, 2009
I have an ASP.NET application with a SQL Server back end. I am storing all my dates in UTC format and doing the appropriate conversions to the local time zone of the browser viewing it. One of the pages asks for a start date and end date (no times).
I am taking the start date and setting the time to 00:00:00 hours (midnight) and I'm taking the End time and adding a time of 23:59:59, so that the date range covers the whole day. Now what I'm trying to do is do a SQL query to do a search for records in this date range. The problem is, the data in SQL is in UTC time and the user is typing their dates and times in their local date and times. My quickest solution was to convert the date and time to UTC, then search the records. However, by doing this, I am to believe ASP.NET converts the given time and date to UTC based on the server time zone. How can I convert a date and time to UTC time based on the time zone of the user?
View 5 Replies
Dec 7, 2009
still having problems with adding (decimal time) to any given time and getting the answer in 24 hours (Military time) I have a picture of what I have at the moment
[Code]...
View 9 Replies
Dec 7, 2009
I am trying to convert information stored in a file to a decimal (or ASCII) format, then write the contents of that file to a new file.
What I have is a list of files that are generated from a cash register. The documentation that was provided to me says that this particular file I am trying to work with has a length of 6, a width of 6, and that it's BCD type.
I've done quite a few google searches and can't seem to find a good solution. I know BCD numbers should be stored as 0000 format. But the problem I'm getting is when I read each part of the file (using my sr.read) I'm getting full numbers..and I am expecting the 0000 format. I'll get a 0, 0, 0, and then all of the sudden I"ll get a number that's 65,000..then I'll get a 34...and there doesn't seem to be any
I'm sure I'm doing something incorrect here, my knowledge of reading HEX, BCD, etc. is very minimal. I'm guessing it has to do with using a filestream, so I can use the fs.ReadByte() method..but when I tried that my program was literally chugging along for several minutes with no sign of ending.[code]...
View 11 Replies
Feb 1, 2010
How do you convert a decimal into a percentage in visual basic? I have the code to get the problem but I need to move the decimal over two places.
View 8 Replies
Oct 5, 2011
Let's say I want to convert a Double x to a Decimal y. There's a lot of ways to do that:
1. var y = Convert.ToDecimal(x); // Dim y = Convert.ToDecimal(x)
2. var y = new Decimal(x); // Dim y = new Decimal(x)
3. var y = (decimal)x; // Dim y = CType(x, Decimal)
4. -- no C# equivalent -- // Dim y = CDec(x)
Functionally, all of the above do the same thing (as far as I can tell). Other than personal taste and style, is there a particular reason to choose one option over the other?
EDIT: This is the IL generated by compiling the three C# options in a Release configuration:
1. call valuetype [mscorlib]System.Decimal [mscorlib]System.Convert::ToDecimal(float64)
--> which calls System.Decimal::op_Explicit(float64)
[Code]....
View 3 Replies
Jan 14, 2012
How to convert a whole number into decimal..For example 70 to .70 because there are some price in my system that needed to be calculated by grams for example $5 per grams... I am saving the price in my database as an integer..
View 2 Replies
Mar 25, 2011
how to convert Decimal To datetime?
View 4 Replies
Jun 8, 2009
I have a decimal value and i want to convert it to datetime.
Example:
Dim Excess As Decimal
Dim FixEncodedHours As Decimal
Dim OvertimeLimit As Decimal = 4D
[code]....
How can i convert the decimal result Hr_Ex to datetime?
View 2 Replies
Mar 13, 2009
I need to convert hex to a decimal in VB.NET. Found several examples in C#, but when I tried to convert to VB.NET I was not successful. An example of a hexadecimal number that I am trying to convert is"A14152464C203230304232323020572F544947455234352E".
View 7 Replies
Oct 7, 2010
How to convert string to decimal ?
input - output
45 - 45.00
45.5 - 45.50
45.51 - 45.51
View 1 Replies
May 11, 2010
The code below works until I try to convert the text box to a decimal. I think it might be because at the time of conversion the text box is empty. If thats the case, where could I do the conversion?[code]...
View 5 Replies
Apr 28, 2007
How can I convert the Tax in the following code which is Double to a two decimal place figure[code]...
View 8 Replies
Feb 18, 2010
How can i convert decimal to string so that in can be transferred to a Label?
View 2 Replies
Jun 18, 2009
I currently doing a project..Using VB2005 To convert hexadecimal to decimal. Something to do with serial port..
View 14 Replies
Mar 28, 2012
I have a textbox aka TXT_Weighting in which I place a value of %.
If I put in a number 0 < number < 100, it works.
However, If I put in 100, I get this error: "error converting Data Type numeric to decimal"
The Database Field has the DataType of decimal(10,2).
I have tried converting it to decimal, string, int, float in the application, but once it saves, gives the same error.
I know it is because of the database field having the type as decimal. But I cant stop the entire application, just so I can change the data type of the field.
How do I save it without getting this error? How do I control it from the application?
[Code]....
View 7 Replies
Jun 27, 2012
What is the cleanest, most readable way to String.Format a decimal with the following criteria
start with a sign symbol (+ or -)
a fixed number of fraction digits
no decimal separator
right aligned
pre-padded with "0"'s
View 3 Replies
Feb 3, 2010
I want to know how to convert a percentage rate such as 4.5% into a decimal number in your code editor in V 2008.For example, the user input is 4.5%. Is there any function available to convert is to 0.045?
View 4 Replies
May 19, 2011
What will be the easiest way to convert a string to decimal?[code]...
View 4 Replies
Jun 20, 2009
wanna convert decimal no 57000 to 57,000, 45750 to 45,750 just wann nos to be more readable in textbox or combobox does vb.net contain any in built feature for that ???
View 7 Replies
Sep 4, 2007
Convert decimal value to feet inches?
eg. convert 68.5 to 5' 8 1/2 " or 5' 8.5" ?
View 4 Replies
Mar 30, 2010
I tried this
Dim value As
String
Dim returnValue As
[code]....
View 8 Replies
Jun 21, 2012
Possible Duplicate: How to convert numbers between hexadecimal and decimal in C#? In C, you can do something like int x = 255; printf("x is: %d and in HEX, x is: %x", x, x); How can I do that in C# or VB.net? print the variable's hex equivalent
View 7 Replies
Jun 15, 2010
I'm trying to figure out how to convert a string to a decimal array (ASCII). The string can be any length and is discovered at runtime.
View 4 Replies
Nov 27, 2010
I extracted text from a third party software application. All the text is now in string and correct in my Form Labels.
Text look like
Label1
0.25
Label2
[Code]....
But I can't convert the labels from string to double or Decimal.
View 9 Replies
Apr 14, 2009
I have an app that deals with currency. For display purposes I use the nifty VB FormatCurrency function which will format based on the OS's region setting. So, if in France you might get 123,45 where in the US you would get 123.45. To perform calculation on these amounts I use CDec() to convert to decimal.
My problem is that when I convert the Decimal to a String using toString() it formats according to the currently set region. I need to be able to always convert the decimal into a String representation for the US, i.e. with decimal points. I thought I would be able to do something similar to this:
.toString("#0.00")
View 3 Replies
Jun 15, 2009
How Convert Decimal , Octal to Ascii ?
View 9 Replies