Now there are many new Versions, but and old wish isn't come true
Normaly in Pascal I can write LCD_out(Variable:2:2)
and then I get a number like 2,35 or LCD_out(Variable:1:32) i get 2,234
At this moment, it is realy complicate to do this with Mikroe, i have to put all into an array and then put every number to its place Thats not, why I use Pascal...
Thing like this, show that the programmers are C or C++ people but has less knowing about Pascal..
Pascal is such a nice language!
Pascal style LCD Out (variable:2:2)
Re: Pascal style LCD Out (variable:2:2)
Hi,
You can use FloatToStr routine for this purpose :
Regards,
Filip.
You can use FloatToStr routine for this purpose :
Code: Select all
FloatToStr(123.567,txt);
Lcd_Out(1, 3, txt);
Filip.
Re: Pascal style LCD Out (variable:2:2)
Ah, ok, thats great
Thanks
Thanks
Re: Pascal style LCD Out (variable:2:2)
nonon, with 1,3 ein can say row 1 and so one..
I don't want say row and colum!!
I want like this si normal is Pascal...
LCDOut(1,3, Variable,:2:2) then I get in row 1 colum 3 a number like xx,xx with two number before and after the pont!
The stringconversion ist not my problem..
I don't want say row and colum!!
I want like this si normal is Pascal...
LCDOut(1,3, Variable,:2:2) then I get in row 1 colum 3 a number like xx,xx with two number before and after the pont!
The stringconversion ist not my problem..
Re: Pascal style LCD Out (variable:2:2)
If I use Float2Str I get
2 / 3 = 0,6666666
But on display I need 0,66 That mean LCD_out(variable:1:2) or I need on display 0,666 that mean ( LCD_out(variable:1:3) this is the way I like from PAscal
See here
http://www.ousob.com/ng/pascal/nge0b2.php
NUMERIC DATA:
# digit: # indicates a digit position. If the field specifier contains no
@ or * characters then unused digits are returned as blanks. If
the specifier is without a sign position (+-) a floating minus sign
will be returned in front of a negative number.
A number greater than the field specifier will be returned as all *.
Example: Form ('####',34.567) = ' 35'
Form ('###.##',12.345) = ' 12.35'
Form ('####.##',-12.3) = ' -12.30'
Form ('###.##,1234,56) = '***.**' { overflow }
Real1 := 1234567.890123456
Real2 := 1.1
StrVar := Form ('############.##',RealVar); { ' 1234567.89' }
WriteLn (Real1:7:2); { '1234567.89' }
WriteLn (Real2:7:2); { ' 1.10' }
@ digit: @ indicates a digit position. If the field specifier contains
one or more of these, then all blanks are returned as leading zeros.
The sign will not be returned unless the + symbol is present.
Example: Form ('@###',34.567) = '0035'
Form ('###.#@',12.345) = '012.35'
2 / 3 = 0,6666666
But on display I need 0,66 That mean LCD_out(variable:1:2) or I need on display 0,666 that mean ( LCD_out(variable:1:3) this is the way I like from PAscal
See here
http://www.ousob.com/ng/pascal/nge0b2.php
NUMERIC DATA:
# digit: # indicates a digit position. If the field specifier contains no
@ or * characters then unused digits are returned as blanks. If
the specifier is without a sign position (+-) a floating minus sign
will be returned in front of a negative number.
A number greater than the field specifier will be returned as all *.
Example: Form ('####',34.567) = ' 35'
Form ('###.##',12.345) = ' 12.35'
Form ('####.##',-12.3) = ' -12.30'
Form ('###.##,1234,56) = '***.**' { overflow }
Real1 := 1234567.890123456
Real2 := 1.1
StrVar := Form ('############.##',RealVar); { ' 1234567.89' }
WriteLn (Real1:7:2); { '1234567.89' }
WriteLn (Real2:7:2); { ' 1.10' }
@ digit: @ indicates a digit position. If the field specifier contains
one or more of these, then all blanks are returned as leading zeros.
The sign will not be returned unless the + symbol is present.
Example: Form ('@###',34.567) = '0035'
Form ('###.#@',12.345) = '012.35'
Re: Pascal style LCD Out (variable:2:2)
Hi,
I understand what are you trying to achieve.
You can, for example, terminate a constant with a zero after a number of digits, like this :
This will write 123.56 on the screen.
Regards,
Filip.
I understand what are you trying to achieve.
You can, for example, terminate a constant with a zero after a number of digits, like this :
Code: Select all
FloatToStr(123.567,txt);
txt [7] = 0;
Regards,
Filip.
Re: Pascal style LCD Out (variable:2:2)
ah, ok, but then the number is wron..because it have to be 123.57 because it have to be round up...