|
String upnum(float target) -> String TForm1::upnum(float target) 올 변경하세요....
이근호 님이 쓰신 글 :
: 안녕하세요 오늘 C++ 빌더를 시작했는데요,
:
: 함수만드는데 계속 에러가 생겨서 질문을 드립니다.
:
: void __fastcall TForm1::Button2Click(TObject *Sender)
: {
:
: no1res = StrToFloat(LabeledEdit8->Text);
: no1fus = StrToFloat(no1res * fuseconst);
: LabeledEdit5->Text = FloatToStr(no1fus).sprintf("%3.2f",no1fus);
: //--------------------------------------
: no2res = StrToFloat(LabeledEdit9->Text);
: no2fus = StrToFloat(no2res * fuseconst);
: LabeledEdit6->Text = FloatToStr(no2fus).sprintf("%3.2f",no2fus);
: //--------------------------------------
: no3res = StrToFloat(LabeledEdit10->Text);
: no3fus = StrToFloat(no3res * fuseconst);
: LabeledEdit7->Text = FloatToStr(no3fus).sprintf("%3.2f",no3fus);
: //--------------------------------------
: LabeledEdit17->Text = FloatToStr(no1res * 1.5).sprintf("%2.1f",no1res * 1.5);
: LabeledEdit18->Text = FloatToStr(no2res * 1.5).sprintf("%2.1f",no2res * 1.5);
: LabeledEdit19->Text = FloatToStr(no3res * 1.5).sprintf("%2.1f",no3res * 1.5);
: //--------------------------------------
: LabeledEdit11->Text = FloatToStr(no1res * 1.5).sprintf("%2.0f",no1res * 1.5);
: LabeledEdit12->Text = upnum(no1res); <--------------이부분에서 다음과 같 에러가 납니다. [C++ Error] Unit1.cpp(88): E2268 Call to undefined function 'upnum'
:
: LabeledEdit13->Text = LabeledEdit19->Text;
:
: }
: String upnum(float target)
: {
: String Astring;
: String Bstring;
: String Finalstring;
: float Afloat;
: float Bfloat;
: Astring = FloatToStr(target).sprintf("%2.1f",target);
: Bstring = FloatToStr(target).sprintf("%2.0f",target);
: if(StrToFloat(Astring)>=StrToFloat(Bstring))
: {
: float finalfloat;
: finalfloat = StrToFloat(Bstring)+0.5;
: Finalstring = FloatToStr(finalfloat);
: }
: else
: { Finalstring = Astring;
:
: }
: return Finalstring;
: }
: //---------------------------------------------------------------------------
:
: 이제 막시작한 초보라서 구조체도 모르고 찾아보면서 했는데 위문제는 게시판 찾아봐도 없더라구요 도와주세요 부탁드립니다.
|