-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpeditor.cpp
44 lines (37 loc) · 823 Bytes
/
peditor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "peditor.h"
#include <math.h>
PEditor::PEditor(int bas)
{
this->Sep = ".";
this->basis = bas;
this->chislo = "";
}
bool PEditor::StrIsNull(){
if(fabs(this->chislo.toDouble()) < 0.000001) return true;
else return false;
}
QString PEditor::addSep(){
if(FSep == false){
this->chislo += Sep;
FSep = true;
}
return this->chislo;
}
QString PEditor::addNum(QString chis){
int temp = chis.toInt();
if(temp > 64) temp -= 55;
if(temp < this->basis) this->chislo += chis;
return this->chislo;
}
QString PEditor::BC(){
this->chislo = this->chislo.left(this->chislo.length()-1);
return this->chislo;
}
QString PEditor::clear(){
FSep = false;
this->chislo = "";
return this->chislo;
}
int PEditor::getBasis(){
return this->basis;
}