trimming a string
-
I have a string in which the numbers are entered and decimal point is also allowed. But, when the user enters a string for eg: 123,43 .....even this should be accepted as number and with "," is assumed as period "." , how can i do this.
use Replace()
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87??6?N8?BcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
I have a string in which the numbers are entered and decimal point is also allowed. But, when the user enters a string for eg: 123,43 .....even this should be accepted as number and with "," is assumed as period "." , how can i do this.
-
I have a string in which the numbers are entered and decimal point is also allowed. But, when the user enters a string for eg: 123,43 .....even this should be accepted as number and with "," is assumed as period "." , how can i do this.
Use a NumericUpDown
-
Use a NumericUpDown
for five-digit numbers such as 123,43 :confused:
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
for five-digit numbers such as 123,43 :confused:
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
NumericUpDown, with two decimal places. I would expect the current culture would determine which decimal delimiter is in use (though I've never tried it).
-
NumericUpDown, with two decimal places. I would expect the current culture would determine which decimal delimiter is in use (though I've never tried it).
PIEBALDconsult wrote:
I would expect the current culture would determine which decimal delimiter is in use
I trust it does, but the way I understood it the OP wanted both period and comma to act as decimal point (which I fully understand, the lack of a single international standard way of using periods and comma's is troublesome). my point however was the up/down doesn't seem very useful for long numbers: when the increment corresponds to the last digit, it takes forever to up/down the leading digits; and when it does not, the last digit(s) are not affected by it. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
PIEBALDconsult wrote:
I would expect the current culture would determine which decimal delimiter is in use
I trust it does, but the way I understood it the OP wanted both period and comma to act as decimal point (which I fully understand, the lack of a single international standard way of using periods and comma's is troublesome). my point however was the up/down doesn't seem very useful for long numbers: when the increment corresponds to the last digit, it takes forever to up/down the leading digits; and when it does not, the last digit(s) are not affected by it. :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
Yes, but I tend to just type the number into the NumericUpDown anyway.
-
Yes, but I tend to just type the number into the NumericUpDown anyway.
I see, I'm still use TextBoxes for that, with some masking if appropriate. The NUD does a lot of masking (and limit checking) but seems to accept multiple decimal points, so it may still need validation. And I wish there were a way to hide the up/down arrows... :)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.