Sponsored Content
Full Discussion: Decimal places
Top Forums Shell Programming and Scripting Decimal places Post 302516750 by arunmanas on Monday 25th of April 2011 02:26:45 AM
Old 04-25-2011
Decimal places

i need to multiplay a number with 1.00.. so that the output should contain two decimal places at end..

for example...

236 * 1.00 = 236.00
245.8 * 1.00 = 245.80

but when i perform multiplication it shows output as.

236
245.8


can anyone help me to get the actual output of 236.00 and 245.80...

thanks in advance...
Arun ManasSmilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

trimm up the decimal places in output

I have a perl script that reports the avg time of a application call and the total number of calls. This works fine, however I would like to trim the number of decimal places reported from 12 to like 3 and I don't know how. Any suggestions? Here is what I use to get the avg time... for $eRef (... (2 Replies)
Discussion started by: theninja
2 Replies

2. Shell Programming and Scripting

Using the "Less Than" (-lt) switch on numbers with decimal places?

I'm using shell scripts to run some commands for the Configuration Management tool called Telelogic Synergy. I need to get the script to compare version numbers of files. The version numbers of the files are part of the actual filename, such as the following example: example_file-1... (7 Replies)
Discussion started by: Glyn_Mo
7 Replies

3. Shell Programming and Scripting

Four decimal places with awk

i have a script in which awk prints "($2-1700)/10000" and the answer is -0.07,but i want the answer in 4 decimal places. that is -0.0700. How can i sue awk to get my results in four decimal places (4 Replies)
Discussion started by: tomjones
4 Replies

4. Shell Programming and Scripting

Arithmetic but keep 2 decimal places

I am trying to perform arithmetric, for example, to increment the value of variable $a (say 3) by 0.05 but when I tried the following expression let a=a+0.05 or a=$((a+0.05)) both returned 3.0499999999999998 I want to keep 2 decimal places so it returns 3.05 instead. (6 Replies)
Discussion started by: piynik
6 Replies

5. Shell Programming and Scripting

Bash Rounding to 2 decimal places

I have a number in a bash variable n, and want to round it to 2 decimal places. How can I do that? n=0.0867268 Need to have num=0.09 (1 Reply)
Discussion started by: kristinu
1 Replies

6. Shell Programming and Scripting

How to round up value upto 2 decimal places using sed?

Please help me in rounding up value upto 2 decimal palces using sed command #!/usr/bin/bash a=15.42 b=13.33 c=`echo $a*$b |bc -l` echo $c above code is is giving output "205.5486" but i want the output as "205.55" Thank you... (15 Replies)
Discussion started by: ranabhavish
15 Replies

7. Shell Programming and Scripting

Printing with decimal places from last 4 digits

I have input file like below, 201424|9999|OSS|622010|RGT|00378228764 201424|8888|OM|587079|RGT|00284329675 201424|7777|OM|587076|RGT|00128671024 201424|6666|OM|581528|RGT|00113552084 Output should be like below, should add decimal (.) from last 4 digits. ... (2 Replies)
Discussion started by: vinothsekark
2 Replies

8. Shell Programming and Scripting

Sum the fields with 6 decimal places - getting only 2 decimal places as output

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

9. Shell Programming and Scripting

Calculate the constant e to 14+ decimal places using integer maths.

Hi guys... I am loving this integer maths thing. 64 bit systems are certainly easier than 32 bit, but hey, I don't intend to leave out my fav' platform. Using one of the 'Brothers' methods, URL inside the code. #!/bin/sh # # #!/usr/local/bin/dash # e_constant.sh # Brother's formula . #... (2 Replies)
Discussion started by: wisecracker
2 Replies
iconv_1251(5)						Standards, Environments, and Macros					     iconv_1251(5)

NAME
iconv_1251 - code set conversion tables for MS 1251 (Windows Cyrillic) DESCRIPTION
The following code set conversions are supported: +-------------------------------------------------------------------------+ | Code Set Conversions Supported | +--------------+--------+--------------+--------+-------------------------+ | Code |Symbol |Target Code |Symbol | Target Output | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |ISO 8859-5 |iso5 | ISO 8859-5 Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |KOI8-R |koi8 | KOI8-R | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |PC Cyrillic |alt | Alternative PC Cyrillic | +--------------+--------+--------------+--------+-------------------------+ |MS 1251 |win5 |Mac Cyrillic |mac | Macintosh Cyrillic | +--------------+--------+--------------+--------+-------------------------+ CONVERSIONS
The conversions are performed according to the following tables. All values in the tables are given in octal. MS 1251 to ISO 8859-5 For the conversion of MS 1251 to ISO 8859-5, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | ISO 8859-5 | MS 1251 | ISO 8859-5 | |24 | 4 |310 |270 | |200 | 242 |311 |271 | |201 | 243 |312 |272 | |202 | 40 |313 |273 | |203 | 363 |314 |274 | |204-207 | 40 |315 |275 | |210 | 255 |316 |276 | |211 | 40 |317 |277 | |212 | 251 |320 |300 | |213 | 40 |321 |301 | |214 | 252 |322 |302 | |215 | 254 |323 |303 | |216 | 253 |324 |304 | |217 | 257 |325 |305 | |220 | 362 |326 |306 | |221-227 | 40 |327 |307 | |230 | 255 |330 |310 | |231 | 40 |331 |311 | |232 | 371 |332 |312 | |233 | 40 |333 |313 | |234 | 372 |334 |314 | |235 | 374 |335 |315 | |236 | 373 |336 |316 | |237 | 377 |337 |317 | |241 | 256 |340 |320 | |242 | 376 |341 |321 | |243 | 250 |342 |322 | |244-247 | 40 |343 |323 | |250 | 241 |344 |324 | |251 | 40 |345 |325 | |252 | 244 |346 |326 | |253-254 | 40 |347 |327 | |255 | 55 |350 |330 | |256 | 40 |351 |331 | |257 | 247 |352 |332 | |260-261 | 40 |353 |333 | |262 | 246 |354 |334 | |263 | 366 |355 |335 | |264-267 | 40 |356 |336 | |270 | 361 |357 |337 | |271 | 360 |360 |340 | |272 | 364 |361 |341 | |273 | 40 |362 |342 | |274 | 370 |363 |343 | |275 | 245 |364 |344 | |276 | 365 |365 |345 | |277 | 367 |366 |346 | |300 | 260 |367 |347 | |301 | 261 |370 |350 | |302 | 262 |371 |351 | |303 | 263 |372 |352 | |304 | 264 |373 |353 | |305 | 265 |374 |354 | |306 | 266 |375 |355 | |307 | 267 |376 |356 | +---------------+----------------+----------------+---------------+ MS 1251 to KOI8-R For the conversion of MS 1251 to KOI8-R , all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | KOI8-R | MS 1251 | KOI8-R | |24 | 4 |310 |351 | |200 | 261 |311 |352 | |201 | 262 |312 |353 | |202 | 40 |313 |354 | |203 | 242 |314 |355 | |204-207 | 40 |315 |356 | |210 | 255 |316 |357 | |211 | 40 |317 |360 | |212 | 271 |320 |362 | |213 | 40 |321 |363 | |214 | 272 |322 |364 | |215 | 274 |323 |365 | |216 | 273 |324 |346 | |217 | 277 |325 |350 | |220 | 241 |326 |343 | |221-227 | 40 |327 |376 | |230 | 255 |330 |373 | |231 | 40 |331 |375 | |232 | 251 |332 |377 | |233 | 40 |333 |371 | |234 | 252 |334 |370 | |235 | 254 |335 |374 | |236 | 253 |336 |340 | |237 | 257 |337 |361 | |241 | 276 |340 |301 | |242 | 256 |341 |302 | |243 | 270 |342 |327 | |244-247 | 40 |343 |307 | |250 | 263 |344 |304 | |251 | 40 |345 |305 | |252 | 264 |346 |326 | |253-254 | 40 |347 |332 | |255 | 55 |350 |311 | |256 | 40 |351 |312 | |257 | 267 |352 |313 | |260-261 | 40 |353 |314 | |262 | 266 |354 |315 | |263 | 246 |355 |316 | |264-267 | 40 |356 |317 | |270 | 243 |357 |320 | |271 | 260 |360 |322 | |272 | 244 |361 |323 | |273 | 40 |362 |324 | |274 | 250 |363 |325 | |275 | 265 |364 |306 | |276 | 245 |365 |310 | |277 | 247 |366 |303 | |300 | 341 |367 |336 | |301 | 342 |370 |333 | |302 | 367 |371 |335 | |303 | 347 |372 |337 | |304 | 344 |373 |331 | |305 | 345 |374 |330 | |306 | 366 |375 |334 | |307 | 372 |376 |300 | +---------------+----------------+----------------+---------------+ MS 1251 to PC Cyrillic For the conversion of MS 1251 to PC Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | PC Cyrillic | MS 1251 | PC Cyrillic | |24 | 4 |332 |232 | |200-207 | 40 |333 |233 | |210 | 260 |334 |234 | |211-227 | 40 |335 |235 | |230 | 260 |336 |236 | |231-247 | 40 |337 |237 | |250 | 360 |340 |240 | |251-254 | 40 |341 |241 | |255 | 55 |342 |242 | |256-267 | 40 |343 |243 | |270 | 361 |344 |244 | |271-277 | 40 |345 |245 | |300 | 200 |346 |246 | |301 | 201 |347 |247 | |302 | 202 |350 |250 | |303 | 203 |351 |251 | |304 | 204 |352 |252 | |305 | 205 |353 |253 | |306 | 206 |354 |254 | |307 | 207 |355 |255 | |310 | 210 |356 |256 | |311 | 211 |357 |257 | |312 | 212 |360 |340 | |313 | 213 |361 |341 | |314 | 214 |362 |342 | |315 | 215 |363 |343 | |316 | 216 |364 |344 | |317 | 217 |365 |345 | |320 | 220 |366 |346 | |321 | 221 |367 |347 | |322 | 222 |370 |350 | |323 | 223 |371 |351 | |324 | 224 |372 |352 | |325 | 225 |373 |353 | |326 | 226 |374 |354 | |327 | 227 |375 |355 | |330 | 230 |376 |356 | |331 | 231 | | | +---------------+----------------+----------------+---------------+ MS 1251 to Mac Cyrillic For the conversion of MS 1251 to Mac Cyrillic, all characters not in the following table are mapped unchanged. +-----------------------------------------------------------------+ | | Conversions|Performed | | | MS 1251 | Mac Cyrillic | MS 1251 | Mac Cyrillic | |24 | 4 |260 |241 | |200 | 253 |262 |247 | |201 | 256 |263 |264 | |202 | 40 |264 |266 | |203 | 257 |266 |246 | |204 | 327 |267 |245 | |205 | 311 |270 |336 | |206 | 240 |271 |334 | |207-211 | 40 |272 |271 | |212 | 274 |273 |310 | |213 | 40 |274 |300 | |214 | 276 |275 |301 | |215 | 315 |276 |317 | |216 | 40 |277 |273 | |217 | 332 |300 |200 | |220 | 254 |301 |201 | |221 | 324 |302 |202 | |222 | 325 |303 |203 | |223 | 322 |304 |204 | |224 | 323 |305 |205 | |225 | 40 |306 |206 | |226 | 320 |307 |207 | |227 | 321 |310 |210 | |230 | 40 |311 |211 | |231 | 252 |312 |212 | |232 | 275 |313 |213 | |233 | 40 |314 |214 | |234 | 277 |315 |215 | |235 | 316 |316 |216 | |236 | 40 |317 |217 | |237 | 333 |320 |220 | |240 | 312 |321 |221 | |241 | 330 |322 |222 | |242 | 331 |323 |223 | |243 | 267 |324 |224 | |244 | 377 |325 |225 | |245 | 242 |326 |226 | |246 | 40 |327 |227 | |247 | 244 |330 |230 | |250 | 335 |331 |231 | |252 | 270 |332 |232 | |253 | 307 |333 |233 | |254 | 302 |334 |234 | |255 | 55 |335 |235 | |256 | 250 |336 |236 | |257 | 272 |337 |237 | |355 | 316 | | | +---------------+----------------+----------------+---------------+ FILES
/usr/lib/iconv/*.so conversion modules /usr/lib/iconv/*.t conversion tables /usr/lib/iconv/iconv_data list of conversions supported by conversion tables SEE ALSO
iconv(1), iconv(3C), iconv(5) SunOS 5.10 18 Apr 1997 iconv_1251(5)
All times are GMT -4. The time now is 02:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy