I am writing a function to convert Decimal/Datetime to the format specified by user.
For example:
If my input string is 1234.1254 and format string is "000.00" then the output should be 1234.13.
Same goes for Datetime, if input is DateTime.Now and format string is "dd/MM/yyyy" then the date should be returned in the given format.
I am not sure how can I achieve this, any suggestions on how can I proceed here?
Thanks
Satya KarkiPosted Jan 20, 2021, 4:09 PM
Rijwan AnsariPosted Jan 20, 2021, 4:01 PM
Sachin SinghPosted Jan 20, 2021, 11:38 AM
for example if user says i want format as dd/mm/yyyy then store that in string pass that to ToString()