mirror of
https://github.com/louisrubet/rpn
synced 2024-11-17 07:47:50 +01:00
Fixed command edit numbers format
This commit is contained in:
parent
98d7ddabf0
commit
9b46151966
1 changed files with 18 additions and 1 deletions
|
@ -37,9 +37,26 @@ void edit(void)
|
|||
{
|
||||
MIN_ARGUMENTS(1);
|
||||
|
||||
// re-write stack objet in a stream
|
||||
stringstream out;
|
||||
|
||||
if (((object*)_stack->back())->_type == cmd_number)
|
||||
{
|
||||
switch(number::s_mode)
|
||||
{
|
||||
case number::std:
|
||||
out.precision(number::s_current_precision);
|
||||
out.unsetf(ios_base::floatfield);
|
||||
break;
|
||||
case number::fix:
|
||||
out << setprecision(number::s_current_precision) << fixed;
|
||||
break;
|
||||
case number::sci:
|
||||
out << setprecision(number::s_current_precision) << scientific;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// re-write stack objet in a stream
|
||||
((object*)_stack->back())->show(out);
|
||||
_stack->pop_back();
|
||||
|
||||
|
|
Loading…
Reference in a new issue