From wiki.ginstr.com
Jump to: navigation, search
m (formatting)
m (formatting)
Line 40: Line 40:
  
 
=====initial format=====
 
=====initial format=====
:<code>@variable/medicalAlert_phone_serialNumber</code> = <code>0.00</code>
+
::<code>@variable/medicalAlert_phone_serialNumber</code> = <code>0.00</code>
  
 
=====initial value outputed as string=====
 
=====initial value outputed as string=====
:<code>273743762924508.00</code>
+
::<code>273743762924508.00</code>
  
 
=====variables.xml=====
 
=====variables.xml=====
Line 66: Line 66:
  
 
=====after action execution format=====
 
=====after action execution format=====
:<code>@variable/medicalAlert_phone_serialNumber</code> = <code>#</code>
+
::<code>@variable/medicalAlert_phone_serialNumber</code> = <code>#</code>
  
 
=====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 17:02, 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