The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Add leading zeroes to numbers in a file raidzero Shell Programming and Scripting 3 06-17-2008 12:06 PM
adding zeroes to all single digits ganiel24 Shell Programming and Scripting 3 06-16-2008 10:59 AM
appending mohan705 Shell Programming and Scripting 6 07-11-2007 08:59 AM
How to trim the leading zeroes in a Currency field ? Amruta Pitkar Shell Programming and Scripting 22 05-29-2007 05:45 AM
appending and sed scotty_123 Shell Programming and Scripting 1 04-26-2007 08:13 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-24-2008
Cool Dude Ani Cool Dude Ani is offline
Registered User
  
 

Join Date: Jun 2008
Location: bangalore
Posts: 3
Question Appending zeroes.......

Hi Friends,

I am new to scripting and i have a problem.I am using /bin/tcsh and want to multiply two decimal numbers and compare the result with another decimal number.The situation is as below.......

There are three decimal numbers.....
a=6.10 , b=3.10 , Value=18.91000000

I tried bc to multiply as below......
c=`echo "scale=8; $a * $b "|bc`;
echo "$c";

But the value of "c" is coming as 18.9100.And when i compare "c" with "Value" for equality,the result is coming as false......

Can anyone help me out so that the value of "c" can be made 18.91000000
i.e filling zeros for remaining places ,upto 8 decimal places.......

Thanks Very Much in advance.....
 

Bookmarks

Tags
awk, awk trim, trim, trim awk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0