You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to suggest some functions to add to the GROQ queries if possible. I would love to add them myself, but not sure how or where to start. I have managed to create one by chaining the existing functions, but for the others I require functions that don't exists.
My suggestions are:
// truncate a string to N chars
string::truncate(string, number)
// Extra rounding functions
math::floor(number)
math::ceil(number)
// Convert/coherse string into a number - Not sure how to implement to float or int (Maybe a flag)
number(string)
// or:
number::int(string)
number::float(string)
Currently I am truncating a string with array::join(string::split((pt::text(body)), "")[0..255], "") which is not ideal 😬
The text was updated successfully, but these errors were encountered:
For reference to create a floor() I am using string::split(string(myNumber), ".")[0] which works, but returns a string, not a number. I can't make a ceil() alternative because I need the result of the floor as a number so that I can add 1 to the resulting value. I'm open to any suggestions or ideas to get around this 😄
Hey 👋
I would like to suggest some functions to add to the GROQ queries if possible. I would love to add them myself, but not sure how or where to start. I have managed to create one by chaining the existing functions, but for the others I require functions that don't exists.
My suggestions are:
Currently I am truncating a string with
array::join(string::split((pt::text(body)), "")[0..255], "")
which is not ideal 😬The text was updated successfully, but these errors were encountered: