![]() |
|
|
|
|
|||||||
| 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 | |||
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
BC Or Xcal
Wich one is better
|
| Forum Sponsor | ||
|
|
|
|||
|
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 \
)
|
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|