From: Mark H. <ma...@ha...> - 2014-09-03 11:45:37
|
I hope this is read by someone,. as I have noticed the web page has been filled with spam,.. My question is as follows:- Trying to produce an output of the following format "/(16.1%) Qstore(54.2%) Mythstore(67.2%) To show disk usage on a media Linux system Have used the following line as a base expression a=(((statfs('/', 'bavail'))*4)/1024/1024);b=(((statfs('/', 'bavail'))*4)/1024/1024);c='/ '.' '.a.'MB /root/ '.b.' MB' and adapted to suit,.. and got to the following:- expression a=(((statfs('/', 'bfree'))*4)/1024/1024);b=(((statfs('/', 'blocks'))*4)/1024/1024);c=(100-((a/b)*100));d='/('.c.'%)' Which nicely displays "/(13.0472%)" .. Perfect, almost!! Just Too many digits after dp. How do I remove the unnecessary decimal placed digits,.. I have evaluated sprint, sed, and bc,.. but I think I may be barking up the wrong tree,.. I am certainly struggling on how to tie these commands into a lcd4linx expression. I have worked out precision is not the way to go. Is any learn'd person of the team able to help me, and put me out of my frustration. Kind Regards Mark |