The plugin also comes with a pre-created set of functions that you can use to for example round a number or format a date.
RNF_Split
RNF_Split($separator,$text)
Used to separate a text by a separator, for example, this code:
Would separate the text “Orange,Apple” by its coma and would create the array [“Orange”,”Apple”]. You can then use the method RNF_Get to retrieve one element of the array
RNF_Get
RNF_Get($index,$array)
Get an element from an array. For example, the following code would return the value “Orange”
RNF_Round
RNF_Round($amount,$decimals=0)
Round a number up to the specified decimals places, be default the function rounds with no decimals.
RNF_DateFormat
RNF_DateFormat($part,$date=null)
Format a date field using the specified format, for example, this formula:
Will format the date using month.day.year format so the date of 12 of May 2022 would return 05.12.22, for a full list of available formatting options please check this link
RNF_StrToTime
StrToTime($date=null)
Convert a date string into a UNIX date time which then you can use in other functions like RNF_DateFormat
RNF_Substr
Substr($string,$offset,$length=null)
Return a part of an string specifying an offset and length, for example, the following code
Would return the the text world,
Alternatively, if you don’t specify the length the function will return the rest of the text (“World how are you” if we use the previous example)
NOV
2023
About the Author:
Im programmer working for an international company. I have programmed since i was 12 and i have done it professionally for 6 years. Programming for a company is fun and i have learned a lot of things but i have always been interested in running my own business so i decided to give it a shot doing what i do best, programming stuffs.