|
by: Mark |
last post by:
I have a Decimal or a Double - your choice. I'd like to print the number as
string with a specified number of decimal places. Let's say my number
110.5, and I'd like to capture it in a string with 3 decimal places:
"110.500". How do you do this? My method below isn't working so hot.
Decimal dcTotal = 110.5;
string strMyString =...
|
by: mp |
last post by:
How do i cast a string from sql to a long? lDocumentVersion is long,
oSqlDR.GetValue(0) returns a string.
lDocumentVersion =oSqlDR.GetValue(0);
Thanks
|
by: Larry Lard |
last post by:
I am trying to apply the following easy-to-state formatting rule to
display a number:
- If the number is positive or negative, display it in the 'default'
way
- If the number is zero, the output should be an empty string
Now I know this is trivial to code, but the elegant solution would be
passing a custom format string to ToString()....
|
by: dbuchanan |
last post by:
How do I explicitly cast a string to Byte?
Here are my circumstances;
The string is from a textbox and could be empty.
The Byte is a tinyint in SQL Server 2000
I am using the AddRow method as shown below and get an
InvalidCastException.
"Cast from string "" to type integer is not valid"
...
|
by: mdawoodk |
last post by:
i am getting error "input string was not in correct format" when
converting a string decimal into integer value.
code is like this:
string strVal = "";
int nVal = 0;
strVal = "14.9";
nVal += Convert.toInt32(strVal);
|
|
by: Dan Holmes |
last post by:
i have a datareader that pulls a field of type numeric(18, 0). the
debugger shows the field as {decimal}. I want to cast it to an int.
This doesn't work (int)dr:. Is that because the definition of
the column would overflow an int? So i would have to do something like
int.Parse(dr.ToString());
dan
|
by: archuleta37 |
last post by:
I'm trying to cast a String from a web forms textbox into an Int16 (see code
below), but it's not quite working. When I post the textbox with numbers (no
alpha chars) I get the following error in my web page:
Exception Details: System.FormatException: Input string was not in a correct
format.
String qty;
foreach (GridViewRow row in...
|
by: elena |
last post by:
Hi, All
Please, i need help with cast string to DateTime:
DateTime dt = new DateTime(2006,09,17); it works i can update Field in
Access DB
Next field is Short Time data type, how i can cast
string myTime = "13:30";
elena
|
by: =?Utf-8?B?U2lzbmF6?= |
last post by:
I'm having a very strange problem I can't seem to figure out and am hoping
maybe somebody has seen it before.
I get an exception "Cast string to date is invalid" with this chunk of code:
' class member
Private m_invDate As Date
' this code is not exact from the program, but essentially does the same
thing. This is were the exception...
|
by: Mike Howarth |
last post by:
Hi
Seem to be having a bit of brainfreeze this evening.
Basically I'm reducing an array of prices like so:
This gives me a string of '86.00.00' which I am trying to use with decimal
objects. Python 2.4 is not particularly happy with this.
Additionally I can't simply convert the string to a decimal as it would be
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
|