Force 2 digit - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9) +--- Thread: Force 2 digit (/showthread.php?tid=5072) |
Force 2 digit - jmir - 03.11.2023 Hi, Is it possible that in an input field two digits are always displayed? For example when 0 is entered in the input field 00 would be shown. Thanks. RE: Force 2 digit - Daniel - 03.11.2023 Which graphical element do you have in mind? RE: Force 2 digit - jmir - 06.11.2023 (03.11.2023, 08:33)Daniel Wrote: Which graphical element do you have in mind? Hi, An object input box (for example for 1 byte object), something like this: RE: Force 2 digit - Daniel - 06.11.2023 As this is not a real number, don't think that this is possible. RE: Force 2 digit - jmir - 07.11.2023 (06.11.2023, 11:29)Daniel Wrote: As this is not a real number, don't think that this is possible. Ok thanks RE: Force 2 digit - domotiqa - 11.01.2024 maybe with script from byte to string... test... and add some 0 in some case ? RE: Force 2 digit - AlexLV - 11.01.2024 Hi, you can try as Domotiqa recommended. Possible variant - show your data with zeroes, when you need enter data - zero is not so important may be. Long time ago I did something you need with hour and minutes less 10, I wanted zero in front: Code: time = { Simple but works. In result I see time with zeroes in front and weekdays text in required language. This is just like an idea. And of course you need take in mind data types and convert it if needed.. BR, Alex RE: Force 2 digit - admin - 12.01.2024 You can simply use string.format: Code: val = 1 For converting number to a string you can either use Custom values or a table instead of multiple IFs: Code: values = { |