MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / setNumber

Function setNumber

packages/core/application-settings/index.android.ts:99–110  ·  view source on GitHub ↗
(key: string, value: number)

Source from the content-addressed store, hash-verified

97}
98
99export function setNumber(key: string, value: number): void {
100 if (!verify(key)) {
101 return;
102 }
103 if (!common.ensureValidValue(value, 'number')) {
104 return;
105 }
106 const editor = sharedPreferences.edit();
107 // SharedPreferences has no getter or setter for double so we convert value and store it as a long
108 editor.putLong(key, java.lang.Double.doubleToRawLongBits(double(value)));
109 editor.apply();
110}
111
112export function remove(key: string): void {
113 if (!verify(key)) {

Callers 1

getNumberFunction · 0.70

Calls 3

verifyFunction · 0.85
editMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected