Re: EuGTK Convert Units

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanks again Irv - for your kind comments and wonderful code demonstrations. smile

Regarding text:format, in the code segment:

results[3] = sprintf("%4g",results[3]) -- may need to change this;  
results = append(results,val)  
set(V2,"text",text:format("[4] [1] = [3:,,.2] [2]",results)) 

It is not clear to me how [3:.2] works in conjunction with format specifiers . I gather it is displaying results[3], but I was under the impression that the .2 meant the value would be displayed to two decimal places. It displays results[3] to 4 decimal places. This truncated the display when I used the program to convert 1 ft/lb2 to N/m2. The full display can be read by using the mouse to select the the result display and "swiping right". Changing %4g to %.2f renders a result value display to two decimal points.

Minor point I suppose, since the mouse can be used to display larger values and It is easy enough to assign a tool-tip to the result display advising the user to "swipe" right.

Can the Result display be lengthened?

Thanks again for developing EuGTK and sharing it with us.

Regards,
Ken

Oh, in the line

if v = 0 then return 1 end if 
-- v should be val 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu