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:
Dave Peticolas 2001-12-05 10:23:11 +00:00
parent 50b9bd053e
commit 0afe940d5f
3 changed files with 25 additions and 0 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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