Hi I want to incremental add hex decimal number to a particula field in file
eg: addr =123 dept1=0
addr = 345 dept2 =1
addr2 = 124 dept3 =2
.
.
.
.
.
.
addr3 =567 dept15 =f
Is there any command which add... (8 Replies)
Hi all,
I am getting following output by using commands like sort, uniq and awk to the standard output.
110 d
40 a
59 c
9 b
3 e
Now at the end I would like to add all the numbers in column 1 and display the count of all numbers i.e. (110 + 40 + 59 + 9 + 3).
Also the output may... (3 Replies)
Anybody please help me...
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart.
This is a unix qn...
plz post algorithm for that :confused: (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Hi guys/gals i have a quick question. I am trying to read from a file and add the values up but the problem is the values are not integers their floats so i tried to used bc but failed epicly lol. Any tips would be great. Thanks
this is the code i have so far :
while read num
do
... (6 Replies)
Hi,
I want to convert two hexadecimal numbers to decimal using unix command line.
1cce446295197a9d6352f9f223a9b698
fc8f99ac06e88c4faf669cf366f60d
I tried using
`echo "ibase=16; $no |bc`
printf '%x\n' "1cce446295197a9d6352f9f223a9b698"
but it doesn't work for such big number it... (4 Replies)
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Hi Experts,
I have requirement to pad a decimal number that should have fixed length as 10.
if number is 234.234 > 234.234000
if number is 12.4 > 12.4000000
if number is 3456.5678 > 3456.56780
from above example we can see that overall length is 10 and padding is being done right sided of... (2 Replies)
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
LEARN ABOUT PHP
msgfmt_set_pattern
MSGFMT_SET_PATTERN(3) 1 MSGFMT_SET_PATTERN(3)MessageFormatter::setPattern - Set the pattern used by the formatter
Object oriented style
SYNOPSIS
public bool MessageFormatter::setPattern (string $pattern)
DESCRIPTION
Procedural style
bool msgfmt_set_pattern (MessageFormatter $fmt, string $pattern)
Set the pattern used by the formatter
PARAMETERS
o $fmt
- The message formatter
o $pattern
- The pattern string to use in this message formatter. The pattern uses an 'apostrophe-friendly' syntax; it is run through
umsg_autoQuoteApostrophe before being interpreted.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
msgfmt_set_pattern(3) example
<?php
$fmt = msgfmt_create( "en_US", "{0, number} monkeys on {1, number} trees" );
echo "Default pattern: '" . msgfmt_get_pattern( $fmt ) . "'
";
echo "Formatting result: " . msgfmt_format( $fmt, array(123, 456) ) . "
";
msgfmt_set_pattern( $fmt, "{0, number} trees hosting {1, number} monkeys" );
echo "New pattern: '" . msgfmt_get_pattern( $fmt ) . "'
";
echo "Formatted number: " . msgfmt_format( $fmt, array(123, 456) ) . "
";
?>
Example #2
OO example
<?php
$fmt = new MessageFormatter( "en_US", "{0, number} monkeys on {1, number} trees" );
echo "Default pattern: '" . $fmt->getPattern() . "'
";
echo "Formatting result: " . $fmt->format(array(123, 456)) . "
";
$fmt->setPattern("{0, number} trees hosting {1, number} monkeys" );
echo "New pattern: '" . $fmt->getPattern() . "'
";
echo "Formatted number: " . $fmt->format(array(123, 456)) . "
";
?>
The above example will output:
Default pattern: '{0,number} monkeys on {1,number} trees'
Formatting result: 123 monkeys on 456 trees
New pattern: '{0,number} trees hosting {1,number} monkeys'
Formatted number: 123 trees hosting 456 monkeys
SEE ALSO msgfmt_create(3), msgfmt_get_pattern(3).
PHP Documentation Group MSGFMT_SET_PATTERN(3)