From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
Line 4: Line 4:
  
 
;Description: Action used to set format to a target when the target is printed out as string.  
 
;Description: Action used to set format to a target when the target is printed out as string.  
:i.e. [[gn:act_sendEmail]] converts values to string values before sending them via email. If we would like to send gps location in some url and not as raw value then we would format the target which holds gps before using email action.
+
:i.e. <code>[[gn:act_sendEmail]]</code> converts values to string values before sending them via email. If we would like to send gps location in some url and not as raw value then we would format the target which holds gps before using email action.
  
 
;Action returns: void
 
;Action returns: void
Line 43: Line 43:
  
 
=====initial value outputed as string=====
 
=====initial value outputed as string=====
<code>273743762924508.00</code>
+
:<code>273743762924508.00</code>
  
 
=====variables.xml=====
 
=====variables.xml=====
Line 69: Line 69:
  
 
=====after action execution value outputed as string=====
 
=====after action execution value outputed as string=====
<code>273743762924508</code>
+
:<code>273743762924508</code>
  
 
<hr>
 
<hr>

Revision as of 16:59, 24 January 2018

gn:act_setFormat

Description
Action used to set format to a target when the target is printed out as string.
i.e. gn:act_sendEmail converts values to string values before sending them via email. If we would like to send gps location in some url and not as raw value then we would format the target which holds gps before using email action.
Action returns
void

Action signatures

[gn:act_setFormat]|[target, format]
Parameter Description
target target target to which format will be set.
format format Format which will be set on target. Format needs to be stored into a text datatype or a string resource.

Example

initial format
@variable/medicalAlert_phone_serialNumber = 0.00
initial value outputed as string
273743762924508.00
variables.xml
<variable id="medicalAlert_phone_serialNumber" type="number" defaultValue=""></variable>
strings.xml
<string name="formatNumber">#</string>
screen.xml
<FrameLayout
    android:id="@+id/exampleFrame"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:visibility="gone"
    gn:act_set="[gn:act_setFormat]|[@variable/medicalAlert_phone_serialNumber,@string/formatNumber];" />
after action execution format
@variable/medicalAlert_phone_serialNumber = #
after action execution value outputed as string
273743762924508