Skip to content

DynValue ToString uses InvariantCulture#327

Open
KiwifruitDev wants to merge 1 commit intomoonsharp-devs:legacy/2.0from
NVGPartners:master
Open

DynValue ToString uses InvariantCulture#327
KiwifruitDev wants to merge 1 commit intomoonsharp-devs:legacy/2.0from
NVGPartners:master

Conversation

@KiwifruitDev
Copy link

@KiwifruitDev KiwifruitDev commented Oct 7, 2023

Performing this change allows decimal values to concatenate through strings correctly.
When a user's Windows regional format uses , for decimal separation, MoonSharp does not handle it in this instance.
For my purposes, I have a software that uses MoonSharp for FFmpeg operations.
This is a snippet from a Lua script that does not execute correctly:

-- Cut material to whatthe length from random start
local multiplier = (whatthelength*0.75)
local start = functions.randomDouble(0, materiallength - multiplier)
functions.runFFmpeg("-ss " .. start .. " -i \"" .. material .. "\" -t " .. multiplier .. " -c:v libx264 -preset ultrafast -crf 18 -vf scale=" .. options.width .. ":" .. options.height .. ",setsar=1:1,fps=fps=30 -y \"" .. temp2 .. "\"")

The values start and multiplier may not output in a valid format, resulting in this error:

Invalid duration specification for ss: 0,5253521033538923

After these changes were made, the issue no longer occurs.
This may be considered a duplicate or continuation of #295.

Performing this change allows decimal values to concatenate through strings correctly.
Simoxus added a commit to Simoxus/moonsharp that referenced this pull request Jan 8, 2026
@Benjamin-Dobell Benjamin-Dobell changed the base branch from master to legacy/2.0 March 3, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant