I'm all about super tidy and readable formuals since in all probability I will be the one who needs to look back at a formula I did years ago to see what it is doing, or if its someone else, the the formulas should be stupid simple to read.
So I like to use Formula Variables. here is some help on them.
https://help.quickbase.com/user-assistance/formula_variables.htmlMaybe in this case it was overkill.
You can also just do this
IF(not begins([My bar code field], "00"), "00" & [My bar code field], [My bar code field])------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com------------------------------
Original Message:
Sent: 08-25-2021 09:41
From: Julie Meeker
Subject: Convert a number to text
Can you explain a little more please. I am not finding a var text or not begins function in the list. what does $ represent?
------------------------------
Julie Meeker
Original Message:
Sent: 08-25-2021 09:17
From: Mark Shnier (YQC)
Subject: Convert a number to text
How about this as a formula text field.
var text MyBarCode = ToText([my bar code field]);
IF(not begins($MyBarCode, "00"), "00" & $MyBarCode, $MyBarCode)
------------------------------
Mark Shnier (YQC)
mark.shnier@gmail.com
Original Message:
Sent: 08-25-2021 09:11
From: Julie Meeker
Subject: Convert a number to text
I need to pad a number with 2 leading zeros to be able to read a legacy bar code. The ToFormattedText function does not actually convert the number so I can't use the PadLeft function. I know there has to be a way to convert a number to text, but I can not seem to find the right function. Any help would be appreciated.
------------------------------
Julie Meeker
------------------------------