Sponsored Content
Full Discussion: printf formatting
Top Forums UNIX for Dummies Questions & Answers printf formatting Post 302400312 by rekha_sri on Wednesday 3rd of March 2010 12:49:21 AM
Old 03-03-2010
Bug

We can do it in php also using number_format() function.

Sample code:

Code:
<?php
$number = 482477.37;
$value = number_format($number,2);
echo "\$$value";
?>

 

10 More Discussions You Might Find Interesting

1. Programming

printf

What is the output of the following program considering an x86 based parameter passing sequence where stack grows towards lower memory addresses and that arguments are evaluated from right to left: int i=10; int f1() { static int i = 15; printf("f1:%d ", i); return i--; } main() {... (2 Replies)
Discussion started by: arunviswanath
2 Replies

2. Shell Programming and Scripting

printf

How to print output in following format? A..................ok AA................ok AAA..............ok AAAAAA........ok "ok" one under one (4 Replies)
Discussion started by: mirusnet
4 Replies

3. Shell Programming and Scripting

awk printf formatting using string format specifier.

Hi all, My simple AWK code does C = A - B If C can be a negative number, how awk printf formating handles it using string format specifier. Thanks in advance Kanu :confused: (9 Replies)
Discussion started by: kanu_pathak
9 Replies

4. Shell Programming and Scripting

IF and awk/printf

Hi Friends, Scripting newb here. So I'm trying to create a geektool script that uses awk and printf to output certain fields from top (namely command, cpu%, rsize, pid and time, in that order). After much trial and error, I've pretty much succeeded, with one exception. Any process whose name... (3 Replies)
Discussion started by: thom.mattson
3 Replies

5. UNIX for Dummies Questions & Answers

Need help with printf

Hi, I have just completed my first script (:D) and now i just need to format it with printf. This is what I have: #!/bin/ksh TOTB=0 TOTF=0 TOTI=0 HOST=`hostname` echo " FSYSTEM BLKS FREE INUSE MOUNTEDON" df -m | grep -v ":"|grep -v Free|grep -v "/proc"| while read FSYSTEM... (2 Replies)
Discussion started by: compan023
2 Replies

6. Shell Programming and Scripting

Help formatting a string. Something like printf?

Hi I'm having a problem with converting a file: ID X 1 7 1 8 1 3 2 5 2 7 2 2 To something like this: ID X1 X2 X3 1 7 8 3 2 5 7 2 I've tried the following loop: for i in `cat tst.csv| awk -F "," '{print $1}'| uniq`;do grep -h $i... (4 Replies)
Discussion started by: flotsam
4 Replies

7. Shell Programming and Scripting

String formatting using awk printf

Hi Friends, I am trying to insert lines of the below format in a file: # x3a4914 Joe 2010/04/07 # seh Lane 2010/04/07 # IN01379 Larry 2010/04/07 I am formatting the strings as follows using awk printf: awk 'printf "# %s %9s %18s\n", $2,$3,$4}' ... (2 Replies)
Discussion started by: sugan
2 Replies

8. Shell Programming and Scripting

Printf command

Hi, I a sequance number from 1-999 and i want asing the value like 001,002..999 Exp: file_001 file_002 file_003... file_999 How can i disaplay the sequnace number as mention above. (3 Replies)
Discussion started by: koti_rama
3 Replies

9. Shell Programming and Scripting

Text Formatting using printf[ksh]

Hi All, I am attempting to create a fixed length tilde delimited file using printf. The variables are initialized to fixed length blank spaces a=' ' b=' ' c=' ' d=' ' Sometimes the variable might contain values and sometimes they are... (5 Replies)
Discussion started by: angie1234
5 Replies

10. Programming

Passing printf formatting parameters as variables

Hi, I haven't programed in C in a few years. I have been doing a lot of shell scripting, I.E. not really programming anything heavy. :o That said, I have a script that gives hourly usage statistics for our email server. It runs w-a-y to slow as a script for my impatience, and needs to... (7 Replies)
Discussion started by: mph
7 Replies
RUNKIT_FUNCTION_REDEFINE(3)						 1					       RUNKIT_FUNCTION_REDEFINE(3)

runkit_function_redefine - Replace a function definition with a new implementation

SYNOPSIS
bool runkit_function_redefine (string $funcname, string $arglist, string $code) DESCRIPTION
Note By default, only userspace functions may be removed, renamed, or modified. In order to override internal functions, you must enable the runkit.internal_override setting in php.ini. PARAMETERS
o $funcname - Name of function to redefine o $arglist - New list of arguments to be accepted by function o $code - New code implementation RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 A runkit_function_redefine(3) example <?php function testme() { echo "Original Testme Implementation "; } testme(); runkit_function_redefine('testme','','echo "New Testme Implementation ";'); testme(); ?> The above example will output: Original Testme Implementation New Testme Implementation SEE ALSO
runkit_function_add(3), runkit_function_copy(3), runkit_function_rename(3), runkit_function_remove(3). PHP Documentation Group RUNKIT_FUNCTION_REDEFINE(3)
All times are GMT -4. The time now is 08:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy