numeric

Numerical formatting using String.Format

Are there any codes that allow for numerical formatting of data when using string.format? ...

Looking for a simple C# numeric edit control

Hello, I am a MFC programmer who is new to C# and am looking for a simple control that will allow number entry and range validation. ...

Is there a (built-in) way in JavaScript to check if a string is a valid number?

I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric() function? ...

How can I check if form input is numeric in PHP?

I need to be able to see if a form input in PHP is numeric. If it is not numeric, the website should redirect. I have tried is_numeric() but it does not seem to work. Code examples will be nice. I am developing a shopping cart that accepts an interger value for the quantity. I am trying this: if(!is_numeric($quantity)){ ...

c# evaluating string "3*(4+2)" yield int 18

Is there a function the the .Net framework that can evaluate a numering expression contained in a string and return the numeric result? IE: string mystring = "3*(2+4)"; int result = EvaluateExpression(mystring); Console.Writeln(result); prints 18. Is there a standard framework function that you can replace my EvaluateExpression with...

is_numeric, intval, ctype__digit.. can you rely on them?

is_numeric, intval, ctype__digit.. can you rely on them? or do i have to use regex? function isNum($str) { return (preg_match("/^[0-9]+$/", $str)); } what do you guys think? am i stupid? ...

Numeric TextBox

Hi, Im new to programming and I dont know very much about but I'm making a calculator, and i want to use a textbox that only acepts numbers and decimals, and when the user paste text from the clipboard the textbox deletes any literal characters, like the MS calc. Please take the time to explain each part so I can learn or write it and ...

Java: Format number in millions

Is there a way to use DecimalFormat (or some other standard formatter) to format numbers like this: 1,000,000 => 1.00M 1,234,567 => 1.23M 1,234,567,890 => 1234.57M Basically dividing some number by 1 million, keeping 2 decimal places, and slapping an 'M' on the end. I've thought about creating a new subclass of N...

Custom Control with Data Type property Issue

I'm building a custom user control. One of the properties must allow the end user to select the numeric data type such as int, short, long, double.... I'm having a problem figuring out what to use as an internal property type, so that when the user selects the DataType option in the property box it will give them a drop down list of...

What are your experiences with numerics libraries for C#, and which would you recommend?

By numerics library I mean a library providing data types such as matrices, vectors, and common (numerical) linear algebra algorithms. Optionally FTT and statistical algorithms. I'm primarily interested in ease of use, ideally getting much closer to Matlab in terms of expressiveness. ...

how to find missing value in sequence within groups in SQL?

i have a table of IDs and positions CREATE TABLE #MissingSequence (ID INT NOT NULL, Position INT NOT NULL) INSERT INTO #MissingSequence (ID,Position) SELECT 36,1 UNION ALL SELECT 36,2 UNION ALL SELECT 36,3 UNION ALL SELECT 36,4 UNION ALL SELECT 36,5 UNION ALL SELECT 36,6 UNION ALL SELECT 44,1 UNION ALL SELECT 44,3 UNION ALL SELECT 44,4 ...

CEdit numeric validation event C++ MFC

Hi, I have a CEdit text box which is a part of a property pane and only allows numeric values (positive integers). The box works fine when people enter non-numeric values, but when they delete the value in the box a dialog pops up saying: "Please enter a positive integer." Here is the situation: 1. I have a number (say 20) in the box. ...

Changing SKUs from Alphanumeric to Numeric, How to!

Our company has thousands of SKUs that currently have 1-6 digits followed by 10 letters that represent various color options, ie. 1550-B= Product 1550 is Black. B for Black. 165334-W = Product is White etc. Our new system will only allow numeric codes (and this will be easier also for our staff to 10-key everything). We need advice how...

int to std::string?

I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but the constructor of std::string doesnt accept a DWORD. What can I do? thanks in advance ...

jQuery find whole number and append decimal

Need to take a SELECT drop down list options and find if any of the values are whole numbers, then append a .00 to the list value option. need to change the value as well. <select> <option value="1">1</option> <option value="1.99">1.99</option> <option value="2.99">2.99</option> <option value="4">4</option> </select> Thanks in...

How to allow only numeric (0-9) in html inputbox using jQuery?

I am creating a web page where I have a input text field in which I want to allow only numeric characters like (0,1,2,3,4,5...9) 0-9. How can i make it using jquery?? Thanks ...

Floating Point Numeric - SAS decimal issue

Does anybody know what SAS format is needed in order to convert this string correctly? data _null_; x="0.14553821459"; y=input(x,best32.); put y=; run; ...

J2ME TextField Exception

When I instantiate a textField, I have a number in it that I want to be the default text. The problem is, I can't seem to be able to place that value into the textfield without getting an error. The strange thing about it is that the same TextField is what I use to set the value of the variable containing the number. TextField myTF = ...

What can cause "The conversion of a char data type to a datetime data type resulted in an out-of-range"?

I am running into an error I am having trouble figuring out. I have 2 tables and I'm trying to copy data from one to the other (simplified view): MyTable ------- ID varchar(11) do not allow nulls Field01 numeric(6,0) allow nulls MyTable_Temp ------------ ID varchar(11) do not allow nulls Field01 numeric(6,0) allow nulls My query loo...

html text box that automatically adds characters

Hey guys I'm trying to make a HTML text box that: 1) only accepts numbers 2) after 3 digits, adds a '.' 3) after 6 digits, adds another '.' So for example, by only typing numbers, you'll get 555.323.7637 4) If you're after a '.', like '555.', then a backspace would change it to '55'. I've been googling around but don't know the exact ...