Sponsored Content
Full Discussion: Insert a decimal point
Top Forums Shell Programming and Scripting Insert a decimal point Post 302120165 by vgersh99 on Monday 4th of June 2007 05:40:03 PM
Old 06-04-2007
nice one, aigles!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get rid of decimal point?

Hi, I have input with decimal point ( 9.99 ) for hours variable hrs. I need to change it to seconds. Here is my code: secs=`/usr/ucb/echo $hrs*3600 |bc` But I don't want to see the decimal point. I can use awk to trim it if there is one. I am just wondering if there is better standard... (2 Replies)
Discussion started by: cin2000
2 Replies

2. Shell Programming and Scripting

Comparing two numbers with decimal point

How to compare two numbers with decimal points ? Is there a way in bash to do this? (33 Replies)
Discussion started by: kinny
33 Replies

3. Shell Programming and Scripting

Insert decimal point for numbers

Hi In Unix, I have a file with some numbers like : 45600 12345 I want to insert a decimal point for these numbers based on user input. If the input is 2, the numbers should be changed to 456.00 123.45 If the input is 3, the numbers should be changed to 45.600 12.345 Can... (2 Replies)
Discussion started by: yoursdivu
2 Replies

4. Shell Programming and Scripting

remove directories with two digits after decimal point

Hi everyone, I am new here and generally not experienced with linux. My question must be easy, but as for now I have no idea how to do it. I have lots of directories with numerical names, e.g. 50 50.1 50.12 etc. What I want is to leave directories with no or single digit after the decimal... (2 Replies)
Discussion started by: cabaciucia
2 Replies

5. Shell Programming and Scripting

awk decimal point numbers matching

Hi All, Can some one help me in identifying the significance of character "$" ,Which is playing critical role in matching decimal point numbers as below. $ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?$/) print}' $ echo "01#.01"|awk '{if ($0 ~ /^+(\.*)?/) print}' 01#.01 $ Regards, Rmkganesh. (3 Replies)
Discussion started by: rmkganesh
3 Replies

6. Shell Programming and Scripting

Help with Round Up with 2 decimal point at specific column

Input file: USA 20.5683 UK 3.54221 Japan 2.54001 China 2.50897 Germany 2.05816 . . Desired output file: USA 20.57 UK 3.54 Japan 2.54 China 2.51 Germany 2.06 . . (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

Moving decimal point in a series of numbers

Hi, i need to move the decimal point from a file listing some numbers like this : 49899.50 49914.55 49894.48 49939.65 49879.44 49919.57 49934.62 49944.67 49954.72 (1 Reply)
Discussion started by: Board27
1 Replies

8. Shell Programming and Scripting

Add Delimiter after 2 decimal point for a particular column

Hi All, Please help for the following scenario where I want to add a delimiter after 2 decimal point integer. Original Line 1007937820§L§2016-12-19§000000002§2018-02-01§2050-12-01§00395§M§146713.57§00005.05000§762.59§00395§M§301223.0528§1165§2017-03-31 20:34:25 Expected Line... (12 Replies)
Discussion started by: ckwan123
12 Replies

9. UNIX for Beginners Questions & Answers

How to add following decimal point to a CSV value?

hi there I being trying to figure out way to add " .0" to an integer value in a csv using sed or awk with out success. just as a work around for 2147483647 32 bit limitation that influxdb is currently having the data base will accept values and work fine if it has the XXX.0 ... (7 Replies)
Discussion started by: sash99
7 Replies

10. UNIX for Advanced & Expert Users

Convert a numeric to 2 decimal point value

Hi , I have a file which contains text like A|Mau|Code|12|Detail B|Mau|Code|20|Header I want to write a command using awk which will output A|Mau|Code|12.00|Detail B|Mau|Code|20.00|Header I used a command like awk -F"|" {printf "%s|%s|%s|%.2f|%s",$1,$2,$3,$4,$5}' which does the... (4 Replies)
Discussion started by: LoneRanger
4 Replies
LOCALECONV(3)						   BSD Library Functions Manual 					     LOCALECONV(3)

NAME
localeconv, localeconv_l -- natural language formatting for C LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <locale.h> struct lconv * localeconv(void); #include <xlocale.h> struct lconv * localeconv_l(locale_t loc); DESCRIPTION
The localeconv() function returns a pointer to a structure which provides parameters for formatting numbers, especially currency values: struct lconv { char *decimal_point; char *thousands_sep; char *grouping; char *int_curr_symbol; char *currency_symbol; char *mon_decimal_point; char *mon_thousands_sep; char *mon_grouping; char *positive_sign; char *negative_sign; char int_frac_digits; char frac_digits; char p_cs_precedes; char p_sep_by_space; char n_cs_precedes; char n_sep_by_space; char p_sign_posn; char n_sign_posn; char int_p_cs_precedes; char int_n_cs_precedes; char int_p_sep_by_space; char int_n_sep_by_space; char int_p_sign_posn; char int_n_sign_posn; }; The individual fields have the following meanings: decimal_point The decimal point character, except for currency values, cannot be an empty string. thousands_sep The separator between groups of digits before the decimal point, except for currency values. grouping The sizes of the groups of digits, except for currency values. This is a pointer to a vector of integers, each of size char, representing group size from low order digit groups to high order (right to left). The list may be terminated with 0 or CHAR_MAX. If the list is terminated with 0, the last group size before the 0 is repeated to account for all the dig- its. If the list is terminated with CHAR_MAX, no more grouping is performed. int_curr_symbol The standardized international currency symbol. currency_symbol The local currency symbol. mon_decimal_point The decimal point character for currency values. mon_thousands_sep The separator for digit groups in currency values. mon_grouping Like grouping but for currency values. positive_sign The character used to denote nonnegative currency values, usually the empty string. negative_sign The character used to denote negative currency values, usually a minus sign. int_frac_digits The number of digits after the decimal point in an international-style currency value. frac_digits The number of digits after the decimal point in the local style for currency values. p_cs_precedes 1 if the currency symbol precedes the currency value for nonnegative values, 0 if it follows. p_sep_by_space 1 if a space is inserted between the currency symbol and the currency value for nonnegative values, 0 otherwise. n_cs_precedes Like p_cs_precedes but for negative values. n_sep_by_space Like p_sep_by_space but for negative values. p_sign_posn The location of the positive_sign with respect to a nonnegative quantity and the currency_symbol, coded as follows: 0 Parentheses around the entire string. 1 Before the string. 2 After the string. 3 Just before currency_symbol. 4 Just after currency_symbol. n_sign_posn Like p_sign_posn but for negative currency values. int_p_cs_precedes Same as p_cs_precedes, but for internationally formatted monetary quantities. int_n_cs_precedes Same as n_cs_precedes, but for internationally formatted monetary quantities. int_p_sep_by_space Same as p_sep_by_space, but for internationally formatted monetary quantities. int_n_sep_by_space Same as n_sep_by_space, but for internationally formatted monetary quantities. int_p_sign_posn Same as p_sign_posn, but for internationally formatted monetary quantities. int_n_sign_posn Same as n_sign_posn, but for internationally formatted monetary quantities. Unless mentioned above, an empty string as a value for a field indicates a zero length result or a value that is not in the current locale. A CHAR_MAX result similarly denotes an unavailable value. While the localeconv() function uses the current locale, the localeconv_l() function may be passed a locale directly. See xlocale(3) for more information. RETURN VALUES
The localeconv() function returns a pointer to a static object which may be altered by later calls to setlocale(3) or localeconv(). ERRORS
No errors are defined. SEE ALSO
setlocale(3), strfmon(3), xlocale(3) STANDARDS
The localeconv() function conforms to ISO/IEC 9899:1999 (``ISO C99''). HISTORY
The localeconv() function first appeared in 4.4BSD. BSD
November 21, 2003 BSD
All times are GMT -4. The time now is 05:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy