mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
g-wrap xaccParseAmount
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6254 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
50b9bd053e
commit
0afe940d5f
@ -117,3 +117,17 @@ gnc_get_account_separator_string (void)
|
|||||||
return sep;
|
return sep;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCM
|
||||||
|
gnc_parse_amount_helper (const char * string, gboolean monetary)
|
||||||
|
{
|
||||||
|
gnc_numeric result;
|
||||||
|
gboolean ok;
|
||||||
|
|
||||||
|
g_return_val_if_fail (string, SCM_BOOL_F);
|
||||||
|
|
||||||
|
ok = xaccParseAmount (string, monetary, &result, NULL);
|
||||||
|
if (!ok)
|
||||||
|
return SCM_BOOL_F;
|
||||||
|
|
||||||
|
return gnc_numeric_to_scm (result);
|
||||||
|
}
|
||||||
|
@ -34,4 +34,6 @@ int gnc_printinfo_p(SCM info_scm);
|
|||||||
|
|
||||||
const char * gnc_get_account_separator_string (void);
|
const char * gnc_get_account_separator_string (void);
|
||||||
|
|
||||||
|
SCM gnc_parse_amount_helper (const char * string, gboolean monetary);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,6 +126,15 @@
|
|||||||
'()
|
'()
|
||||||
"Shutdown the expression parser and free any associated memory.")
|
"Shutdown the expression parser and free any associated memory.")
|
||||||
|
|
||||||
|
(gw:wrap-function
|
||||||
|
mod
|
||||||
|
'gnc:parse-amount
|
||||||
|
'<gw:scm>
|
||||||
|
"gnc_parse_amount_helper"
|
||||||
|
'(((<gw:m-chars-caller-owned> gw:const) string)
|
||||||
|
(<gw:bool> monetary))
|
||||||
|
"Parse the expression and return either a gnc numeric or #f.")
|
||||||
|
|
||||||
(gw:wrap-function
|
(gw:wrap-function
|
||||||
mod
|
mod
|
||||||
'gnc:setup-gettext
|
'gnc:setup-gettext
|
||||||
|
Loading…
Reference in New Issue
Block a user