![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
| View Poll Results: Bc Or Xcal | |||
| Bc |
|
3 | 60.00% |
| Xcal |
|
2 | 40.00% |
| Voters: 5. You may not vote on this poll | |||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I vote for bc (or dc, or what else), because it is standard UNIX, unlike Xcal AND it is easy to script. Here is a rounding function in ksh, try scripting it with xcal instead of bc, here is just the core of it:
Code:
# calculate rounded value
nValue=$( print "scale=$iDigits; $( print "scale=$iDigit2; $nValue + $nAdd" |\
bc \
) / 1" | \
bc \
)
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|