Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit321ddff

Browse files
author
Nikita Glukhov
committed
Add JsonValueInitDouble()
1 parent143a5eb commit321ddff

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/include/utils/json_generic.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,15 @@ JsonValueInitFloat(JsonbValue *jbv, float4 f)
436436
returnjbv;
437437
}
438438

439+
staticinlineJsonbValue*
440+
JsonValueInitDouble(JsonbValue*jbv,float8f)
441+
{
442+
jbv->type=jbvNumeric;
443+
jbv->val.numeric=DatumGetNumeric(DirectFunctionCall1(
444+
float8_numeric,Float8GetDatum(f)));
445+
returnjbv;
446+
}
447+
439448
#definepushJsonbKey(pstate,jbv,key) \
440449
pushJsonbValue(pstate, WJB_KEY, JsonValueInitString(jbv, key))
441450

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp