[Gambas-user] Problem with lcdnumber - don't show decimal point
sbungay
sbungay at ...981...
Fri Feb 9 02:34:54 CET 2007
OK. So don't manipulate the LCD directly, always move the data
through a string first and only send the values in the string to the LCD
after a numeric keypress.
So your code would change a little... I haven't tried this out yet, but
it SHOULD work :)
' This is at the Class declaration level.
PRIVATE mTPVString AS String
PUBLIC SUB botones_display_Click()
SELECT CASE LAST.get_action()
CASE "C"
TPV.display.Value = 0 ' This part can remain the same.
CASE "0" TO "9"
' I am assuming that you want 10 digits INCLUDING the decimal?
' This would be 7 numbers before the decimal and 2 afterward.
If len(mTPVString) + len(LAST.tag) < 10 then
mTPVString = mTPVString & LAST.tag
TPV.display.Value = CFloat(mTPVString)
end if
' <Olde Code>
' IF Len(CString(TPV.display.Value)) < 10 THEN
' TPV.display.Value = TPV.display.value & CFloat(LAST.tag)
' END IF
'</OldeCode>
CASE "."
' We don't push the decimal point to TPV, just add it
' to mTPVString
mHoldString = mHoldString & "."
' Olde Code
' IF (InStr(CString(TPV.display.Value), ".") = 0) THEN
' TPV.display.Value = TPV.display.Value & "." --> DONT WORK!
' END IF
'</OldeCode>
Steve
jj at ...1636... wrote:
> Exactly. That's the problem.
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier.
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list