numbers

How do you use the different Number Types in Objective C

So I am trying to do a few things with numbers in Objective C and realize there is a plethora of options, and i am just bewildered as to which type to use for my app. so here are the types. NSNumber (which is a class) NSDecmial (which is a struct) NSDecimalNumber (which is a class) float/double (which are primitive types) so e...

Check if variable has a number php

I want to check if a variable has a number in it, I just want to see if there is one I don't care if it has any thing else in it like so: "abc" - false "!./#()" - false "!./#()abc" - false "123" - true "abc123" - true "!./#()123" - true "abc !./#() 123" -true There are easy ways of doing this if you want to know that is all numbers bu...

Where are "Special Numbers" mentioned in Concrete Maths used?

I was glancing through the contents of Concrete Maths online. I had at least heard most of the functions and tricks mentioned but there is a whole section on Special Numbers. These numbers include Stirling Numbers, Eulerian Numbers, Harmonic Numbers so on. Now I have never encountered any of these weird numbers. How do they aid in com...

iphone sim number

how to get the phone number in iPhone using iPhone programming... i mean code ...

Oddity with ToString() custom number formatting

I am trying to convert numbers in the form 123456 to 123,456 which I find easy enough by using the .NET ToString() method with a custom format of N0. However in one case of data I am getting strange formats whilst using this method. In this case I am generating a DataTable dynamically for my input table to test the code. DataTable dt ...

Number to words in Rave Report

I have managed to design a report the way I want but I am not able to get Rave Report to print/convert Grand total to Words like for example if the grand total is 1,200.00 it should print One Thousand and Two Hundred only. Is something like this possible in Rave Report? ...

Looking for code to add 'featured' to particular number sequence

I was thinking of the best way of adding a class of 'featured' (in classic ASP), in this sequence of records from a DB: N,Y,Y,N,N,Y,Y The sequence is: 2 3 6 7 10 11 14 15 18 19... I already have a count (starting from 1 going for each record) Many thanks! ...

What is the maximum value of a number in Lua?

There doesn't seem to be a clear answer to this in the documentation. I'm interested in incrementing a variable time that counts the seconds since the program started. If the maximum value can count far into the future, like 100 years, then I don't care about letting the variable increment forever. Otherwise I'm going to have to think o...

Diehard test only integers?

i want to test some "random" numbers in (0 1). i will test them with the diehard tests battery, but i dont know if it tests numbers in (0 1). so diehard test any kind of numbers, or it just test intergers? ...

Nice PHP algorithm to convert 120000000 into '120 mil' ?

I've been struggling to find a nice algorithm to change a number (could be a float or integer) into a nicely formated human readable number showing the units as a string. For example: 100500000 -> '100.5 Mil' 200400 -> '200.4 K' 143000000 -> '143 Mil' 52000000000 -> '52 Bil' etc, you get the idea. Any pointers? ...

Most efficient sorting algorithm for a large set of numbers

I'm working on a large project, I won't bother to summarize it here, but this section of the project is to take a very large document of text (minimum of around 50,000 words (not unique)), and output each unique word in order of most used to least used (probably top three will be "a" "an" and "the"). My question is of course, what would...

Correct formatting of numbers with errors (C++)

I have three sets of numbers, a measurement (which is in the range 0-1 inclusive) two errors (positive and negative. These numbers should be displayed consistently to the number of significant figures, rounded up, which corresponds to the first non-zero entry in either of the number. This requirement is skipped on the measurement if it...

JavaScript string and number conversion

How can I do the following in JavaScript? Step (1) Concatenate "1", "2", "3" into "123" Step (2) Convert "123" into 123 Step (3) Add 123 + 100 = 223 Step (4) Covert 223 into "223" ...

How do you extract a numerical value from a string in a MySQL query?

I have a table with two columns: price (int) and price_display (varchar). price is the actual numerical price, e.g. "9990" price_display is the visual representation, e.g. "$9.99" or "9.99Fr" I've been able to confirm the two columns match via regexp: price_display not regexp format(price/1000, 2) But in the case of a mismatch...

MS Access, number formatting.

I need to display a number (real), ie 1234.567 like "1.234,56" or "1,234.56". I know that I have to use Format() but I can't figure it out. (It's for a textbox where the 'Control Source' property is set to some number field) ...

C/C++ Identify the digits in a given number.

Hello everyone, i'm new to programming.. and i'm stuck at a problem.. I want my program to identify the separate digits in a given number, like if i input 4692, it should identify the digits and print 4 6 9 2. And yeah, without using arrays.. Thanks in advance! ...

JQuery - Validate() and grouping similar form items

I have the following form: http://fuzzysiberians.com/app4.cfm when there is no social security number, my error message is being displayed after each text field. Is there a way to group these error messages so that there will be 3 text boxes next to each other and then display only one error message? ...

Javascript extracting number from string

Hi, I have a bunch of strings extracted from html using jQuery. They look like this: var productBeforePrice = "DKK 399,95"; var productCurrentPrice = "DKK 299,95"; I need to extract the number values in order to calculate the price difference. (So I wend up with ≈ var productPriceDiff = DKK 100"; or just: var productPriceDiff ...

PHP: intval() equivalent for numbers >= 2147483647

Hello! In PHP 5, I use intval() whenever I get numbers as an input. This way, I want to ensure that I get no strings or floating numbers. My input numbers should all be in whole numbers. But when I get numbers >= 2147483647, the signed integer limit is crossed. What can I do to have an intval() equivalent for numbers in all sizes? Her...

sed to replace random numbers

Hello, i need to let sed replace some url in alot of file each file has the following http://www.expample.com/file.php?id=xxxxxxx where xxxxx consist of random numbers , random depth in each file like file 1 _h**p://www.expample.com/file.php?id=xx file 2 _h**p://www.expample.com/file.php?id=xxxxxxxx etc thanks in advance ...