473,385 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how let insert real number

how can i insert only a real number (an integer with only one decimal
separator) in a edit field
perhaps in onchange event I have to test if the decimal separator in the
text is >0 I simply have to put it as a null key
Jul 23 '05 #1
2 1964

"SAN CAZIANO" <al**********@tin.it> wrote in message news:Nl*********************@news4.tin.it...
how can i insert only a real number (an integer with only one decimal
separator) in a edit field


perhaps in onchange event I have to test if the decimal separator in the
text is >0 I simply have to put it as a null key


Hi SAN.

I'm not sure if I understand the beginning of your post. An Iinteger NEVER has a decimal in it. In other words
6.0 is NOT an Integer. It is Real yes but not an Integer. Seperators are usually used in how an array is contructed For example var arr = 3,5,7,8 are comma seperated Integers; the array is arr. If you want to use . as a seperator then 3.5.7.8 are decimal seperated Integers. I don't think you can have decimal seperated Real numbers.

As for your javascript ? the experts can probably give you what you want. But this amatuer doesn't understand your intro.
Jul 23 '05 #2
On Sat, 09 Oct 2004 16:29:33 GMT, SAN CAZIANO <al**********@tin.it> wrote:
how can i insert only a real number (an integer with only one decimal
separator) in a edit field

perhaps in onchange event I have to test if the decimal separator in the
text is >0 I simply have to put it as a null key


The best way to check an input format is using a regular expression. Real
numbers can use this basic check:

if(/^(0|[1-9]\d*)\.\d\d$/.test( string )) {
// test succeeded

That expression ensures that a number cannot include leading zeros, and
must have a decimal portion containing two numbers.

0.14 and 12.00

are valid numbers, but

02.50 and 1.0 and .25

are not. If you have specific requirements, such as the inclusion of
integer values, or a range of allowable decimal digits (rather than the
current two), they should be easy to accomodate. Just ask.

Hope that helps,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ImraneA | last post by:
Hi there Application : Access v2K/SQL 2K Jest : Using sproc to append records into SQL table Jest sproc : 1.Can have more than 1 record - so using ';' to separate each line from each other.
4
by: teddysnips | last post by:
I am trying to insert a row into a table using a stored procedure and I get the following error if I try this from QA: INSERT failed because the following SET options have incorrect settings:...
0
by: ImraneA | last post by:
Hi there I had pleasure of upsizing Access v97 db to Access v2K/SQL 2K. Wish to provide some knowledge gained back to community - hopefully help others. 1.Question how do you test stored...
4
by: JMCN | last post by:
is it possible to insert a value into a field when you append the new records to the table instead of appending the one new record at a time in order to insert a new value? for example, i would...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
3
by: pjcraig | last post by:
This is driving me crazy! I have a form that a user will access from another form by selecting the item that they wish to view. When they open the new form, I pass through the id of the item they...
46
by: dunleav1 | last post by:
I have a process that does inserts that runs 50% slower that Oracle and Mssql. Queries normally take 50% slower than normal. DB2, Oracle, Mssql all are configured on same os, same disk array...
11
by: mdboldin | last post by:
I hav read on this forum that SQL coding (A) below is preferred over (B), but I find (B) is much faster (20-40% faster) (A) sqla= 'INSERT INTO DTABLE1 VALUES (%d, %d, %d, %f)' % values...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.