Hi ,
I am facing a problem .. which looks simple... but took 2 days of mine.. even now it is not solved completely..
I have one variable..., want to know whether that variable contains number... canbe +ve or -ve ...
Values
+35 --- number
-43 --- number
45A -- non number... (12 Replies)
Hi,
I have one file like 00123. And this file name is generated as a sequence.
So how can I confirm the generated file name is a number, not a special character or alphabets.
Can anybody help me out.
Thanks in advance. (3 Replies)
Hey,
I am trying to check if an integer is even in a tcsh script
This is what I am running now
set lattest = ` echo $latmin "%2" | bc -l `
echo $lattest
if ( $lattest == 0 ) then
echo "min is already even"
else if ( $lattest =! 0 ) then
set latmin = ` echo $latmin "+1" |... (2 Replies)
I have 2 and three params, both I should make sure thay numbers at one single line insted of checking for each one .
Example I wroote the following way.. checking for 2 and three seperately but I shud be able to do it at on statement
echo $2 | egrep '^+$' >/dev/null 2>&1
if ; then
echo... (2 Replies)
Hi,
We are getting a curios result in one of AIX script. Its executed using !/bin/ksh .
After following line we get result of 3 in in the variable instance_count.
instance_count=`ps -ef | grep "script_check_instances.sh" | grep -v "grep" | wc -l`
But once we do a "ps -aef | grep... (2 Replies)
Hi Gurus,
I need check existing number of file based on the list in file list.
for example:
in my file list. I have below:
abc, file1.txt
abc, file2.txt
abc, file3.txt
abc, file4.txt
cde, filea1.txt
cde, filea2.txt
cde, filea3.txt
...
in my current file direcotry, I have file:... (0 Replies)
Hello,
May i please know how do i check if the given input argument is one of the listed numbers then success else failure. I am using bash shell.
if
then
echo "success"
else
echo "failure"
fi
Thank you. (2 Replies)
Discussion started by: Ariean
2 Replies
LEARN ABOUT PHP
numfmt_parse
NUMFMT_PARSE(3) 1 NUMFMT_PARSE(3)NumberFormatter::parse - Parse a number
Object oriented style
SYNOPSIS
public mixed NumberFormatter::parse (string $value, [int $type], [int &$position])
DESCRIPTION
Procedural style
mixed numfmt_parse (NumberFormatter $fmt, string $value, [int $type], [int &$position])
Parse a string into a number using the current formatter rules.
PARAMETERS
o $fmt
-NumberFormatter object.
o $type
- The formatting type to use. By default, NumberFormatter::TYPE_DOUBLE is used.
o $position
- Offset in the string at which to begin parsing. On return, this value will hold the offset at which parsing ended.
RETURN VALUES
The value of the parsed number or FALSE on error.
EXAMPLES
Example #1
numfmt_parse(3) example
<?php
$fmt = numfmt_create( 'de_DE', NumberFormatter::DECIMAL );
$num = "1.234.567,891";
echo numfmt_parse($fmt, $num)."
";
echo numfmt_parse($fmt, $num, NumberFormatter::TYPE_INT32)."
";
?>
Example #2
OO example
<?php
$fmt = new NumberFormatter( 'de_DE', NumberFormatter::DECIMAL );
$num = "1.234.567,891";
echo $fmt->parse($num)."
";
echo $fmt->parse($num, NumberFormatter::TYPE_INT32)."
";
?>
The above example will output:
1234567.891
1234567
SEE ALSO numfmt_get_error_code(3), numfmt_format(3), numfmt_parse_currency(3).
PHP Documentation Group NUMFMT_PARSE(3)