RegularExpression To Convert From Fraction To Decimal?
Jan 28, 2011
I need a RegularExpression that can convert a string from a fraction or decimal like "1/2" or "0.5" to a decimal "0.5". It needs to handle both cases. Input can be either fractional or decimal, output must be decimal...
View 7 Replies
ADVERTISEMENT
Jun 10, 2011
I need a RegularExpression that can convert a string from a fraction or decimal like "1/2" or "0.5" to a decimal "0.5". It needs to handle both cases. Input can be either fractional or decimal, output must be decimal.
View 3 Replies
Feb 25, 2012
I've got a problem. I need to convert a decimal to a fraction by a BUTTON. I've tried several times through everything I found on the internet. Until Dll's I've tried using
View 2 Replies
May 22, 2012
Is there a format string to format a decimal to 000000000,00. So first 9 digits, right padded with zeros if needed; a comma as fraction separator and two fraction digits.
0 => 00000000,00
12 => 00000012,00
987456,456 => 000987456,46
So something like myDecimal.ToString("D9") together with .ToString("F2").
View 3 Replies
Nov 1, 2010
How do you convert a fraction to the lowest available fraction. If you type in 500/1000, the program will automaticly convert to 1/2. Is there any mathematical way to do this?
View 11 Replies
Dec 20, 2010
how do you convert a decimal ( decimal place holder = dot) to a decimal (decimal place holder =comma)?
View 6 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
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
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
Aug 19, 2010
I have a nomenclature to respect while performing some tasks against the Active Directory.Here's the nomenclature:
TT-EEE-Mnemonic: if TT = 'GA' or 'GS' or 'PA' or 'PF' -> the schema to create is a "group", with a groupScope of Global.
[code].....
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