Spreadsheet convert to string
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Spreadsheet convert to string
How to convert a value into a string?
Inside a cell =str() doesn't work.
Inside a cell =str() doesn't work.
Re: Spreadsheet convert to string
If your question is to force a cell content to be a string, just use single quote (') as the first character.
In other case please make your question more precise.
In other case please make your question more precise.
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Spreadsheet convert to string
Just enter
Code: Select all
'3
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Spreadsheet convert to string
I didn't explain myself well, I want to use (convert) the contents of A1 (float or int) as a string, to concatenate two cells, when one of the two cells is already a string.
=A1 + B1 works only with two values or with two strings, not with one string and one value.
=A1 + B1 works only with two values or with two strings, not with one string and one value.
Re: Spreadsheet convert to string
I think you're asking for dynamic string conversion so you can have a string in one cell and the value of the string in another cell. I'm not aware it can do that. In fact, I'm not aware of any functions callable from the Spreadsheet expression editor.
I'd love to have a couple of functions, like "pi()". I link to a spreadsheet of standard values, for that stuff. It works well enough.
OpenBrain's single quote tip sweetened a couple of my spreadsheets. I was using full quotes as a work around but they were visible.
Thank you, OB.
Sorry it wasn't more helpful for you, Renatorivo. Perhaps someone smarter than me will be able to solve your problem.
I'd love to have a couple of functions, like "pi()". I link to a spreadsheet of standard values, for that stuff. It works well enough.
OpenBrain's single quote tip sweetened a couple of my spreadsheets. I was using full quotes as a work around but they were visible.
Thank you, OB.
Sorry it wasn't more helpful for you, Renatorivo. Perhaps someone smarter than me will be able to solve your problem.
Re: Spreadsheet convert to string
I'm not aware of that being possible ATM. There is a quite big PR pending from @realthunder that is refactoring the expressions. Maybe he included this. I'll try to find the PR.renatorivo wrote: ↑Fri Jul 10, 2020 3:41 pm I didn't explain myself well, I want to use (convert) the contents of A1 (float or int) as a string, to concatenate two cells, when one of the two cells is already a string.
=A1 + B1 works only with two values or with two strings, not with one string and one value.
Pi is implemented. Just use :
Code: Select all
pi
-
- Veteran
- Posts: 2611
- Joined: Tue Feb 21, 2012 8:07 pm
- Location: Torino - Italy
Re: Spreadsheet convert to string
Are you referring to this? https://tracker.freecadweb.org/view.php?id=3460
Re: Spreadsheet convert to string
It's wider than just a single ticket.renatorivo wrote: ↑Fri Jul 10, 2020 7:25 pm Are you referring to this? https://tracker.freecadweb.org/view.php?id=3460
https://forum.freecadweb.org/viewtopic.php?f=17&t=43412
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Spreadsheet convert to string
A workaround:
Right click in property view, enable show all checkbox.
Right click again in property view, add property of type App::PropertyString. Set this new string property to cell A1 using expressions. Be sure to uncheck the option to prefix group name.
In the spreadsheet cell refer to the new string property by its name you gave to it (in my case I called it converter).
Right click in property view, enable show all checkbox.
Right click again in property view, add property of type App::PropertyString. Set this new string property to cell A1 using expressions. Be sure to uncheck the option to prefix group name.
In the spreadsheet cell refer to the new string property by its name you gave to it (in my case I called it converter).
- Attachments
-
- converter.FCStd
- (5.78 KiB) Downloaded 75 times