Jump to content

[Samples] Sexagesimal Expression s Evaluator


This topic is 4855 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Because it is an accepted format to express a sexagesimal value - and also because the result remains usable for further calculations.

And - I forgot to mention - you could let the Time function do all the work, i.e.

Time ( 0 ; 0 ; adj )






BTW, you can do this even with your text result, e.g.




Hour ( adj ) & "°" & ... 

Link to comment
Share on other sites

This is a nice suggestion !

So I end up with:

Let([

adj = "(" & Substitute ( TrimAll ( input ; 1 ; 3 ) ; [ ¶ ; "" ] ; [ "-" ; ")-("] ; [ "+" ; ")+("] ; [ "*" ; ")*(" ] ; [ "/" ; ")/("] ; [ "x" ; ")*(" ] ; [ ":" ; ")/("]) & ")" ;

adj = Mod ( Evaluate ( Substitute ( adj ; [ "()" ; ""] ; [ "°" ; "*3600 "] ; [ "'" ; "*60 "] ; [ "\"" ; " "] ;[ " " ; "+"] ; [ "+)" ; ")" ] ) ) ; 360*3600 )

];

Hour ( adj ) & "°" & If ( Minute ( adj ) ; Minute ( adj ) & "'" ) & If ( Seconds ( adj ) ; Seconds ( adj ) & "\"" )

)

BTW: I wished to use the List ( ) function in the result ( to get only not empty values ), but could not find a way.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.